Rooni commited on
Commit
f134788
1 Parent(s): 4c2370b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,7 +13,7 @@ headers = {"Authorization": f"Bearer {API_TOKEN}"}
13
 
14
  models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL LoRA", "epiCRealism", "PixelArt XL", "NewReality XL", "Anything 5.0", "PixArt XL 2.0"]
15
 
16
- def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, seed=-1, sampler="DPM++ 2M Karras"):
17
  language = detect(prompt)
18
  key = random.randint(0, 999)
19
 
@@ -58,7 +58,7 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, seed=-1, samp
58
  "is_negative": is_negative,
59
  "steps": steps,
60
  "cfg_scale": cfg_scale,
61
- "seed": seed
62
  }
63
 
64
  image_bytes = requests.post(API_URL, headers=headers, json=payload).content
 
13
 
14
  models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL LoRA", "epiCRealism", "PixelArt XL", "NewReality XL", "Anything 5.0", "PixArt XL 2.0"]
15
 
16
+ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, seed=None, sampler="DPM++ 2M Karras"):
17
  language = detect(prompt)
18
  key = random.randint(0, 999)
19
 
 
58
  "is_negative": is_negative,
59
  "steps": steps,
60
  "cfg_scale": cfg_scale,
61
+ "seed": seed if seed is not None else random.randint(-1, 2147483647)
62
  }
63
 
64
  image_bytes = requests.post(API_URL, headers=headers, json=payload).content