ParahumanSkitter commited on
Commit
6a9db44
·
verified ·
1 Parent(s): acfa7e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- result = models_load[model_str](f'{prompt} {noise}', negative_prompt=negative_prompt)
 
 
 
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}")