ParahumanSkitter
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,10 @@ def gen_fn(model_str, prompt, negative_prompt, max_retries=10):
|
|
41 |
while retries < max_retries:
|
42 |
try:
|
43 |
noise = str(randint(0, 9999999))
|
44 |
-
|
|
|
|
|
|
|
45 |
return result
|
46 |
except Exception as e:
|
47 |
print(f"Error generating image: {e}")
|
|
|
41 |
while retries < max_retries:
|
42 |
try:
|
43 |
noise = str(randint(0, 9999999))
|
44 |
+
if hasattr(models_load[model_str], 'negative_prompt'):
|
45 |
+
result = models_load[model_str](f'{prompt} {noise}', negative_prompt=negative_prompt)
|
46 |
+
else:
|
47 |
+
result = models_load[model_str](f'{prompt} {noise}')
|
48 |
return result
|
49 |
except Exception as e:
|
50 |
print(f"Error generating image: {e}")
|