DazDin commited on
Commit
aa881c7
·
verified ·
1 Parent(s): f0623f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -42,7 +42,11 @@ def gen_fn(model_str, prompt, neg_prompt=None):
42
  noise = str(randint(0, 9999))
43
  if neg_prompt is None:
44
  neg_prompt = 'negative prompt'
45
- return models_load[model_str](prompt=prompt, noise=noise, negative_prompt=neg_prompt)
 
 
 
 
46
 
47
  def make_me():
48
  with gr.Row():
 
42
  noise = str(randint(0, 9999))
43
  if neg_prompt is None:
44
  neg_prompt = 'negative prompt'
45
+ model_func = models_load[model_str]
46
+ if hasattr(model_func, 'accepts_negative_prompt') and model_func.accepts_negative_prompt:
47
+ return model_func(prompt=prompt, noise=noise, negative_prompt=neg_prompt)
48
+ else:
49
+ return model_func(prompt=prompt, noise=noise)
50
 
51
  def make_me():
52
  with gr.Row():