ai-forever commited on
Commit
83244a3
β€’
1 Parent(s): f874e14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -12,8 +12,8 @@ model = get_kandinsky2('cuda', task_type='text2img', model_version='2.1', use_fl
12
 
13
 
14
 
15
- def infer(prompt):
16
- images = model.generate_text2img(prompt, num_steps=100,
17
  batch_size=1, guidance_scale=4,
18
  h=768, w=768,
19
  sampler='p_sampler', prior_cf_scale=4,
@@ -197,6 +197,13 @@ Kandinsky 2.1 was trained on a large-scale image-text dataset LAION HighRes and
197
  rounded=(True, False, False, True),
198
  container=False,
199
  )
 
 
 
 
 
 
 
200
  btn = gr.Button("Run").style(
201
  margin=False,
202
  rounded=(False, True, True, False),
 
12
 
13
 
14
 
15
+ def infer(prompt, negative):
16
+ images = model.generate_text2img(prompt, negative_prior_prompt=negative,negative_decoder_prompt=negative, num_steps=100,
17
  batch_size=1, guidance_scale=4,
18
  h=768, w=768,
19
  sampler='p_sampler', prior_cf_scale=4,
 
197
  rounded=(True, False, False, True),
198
  container=False,
199
  )
200
+ negative = gr.Textbox(
201
+ label="Enter your negative prompt", show_label=False, max_lines=1
202
+ ).style(
203
+ border=(True, False, True, True),
204
+ rounded=(True, False, False, True),
205
+ container=False,
206
+ )
207
  btn = gr.Button("Run").style(
208
  margin=False,
209
  rounded=(False, True, True, False),