Added Inference Steps option

#6
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -61,6 +61,7 @@ def generate(
61
  width: int = 1024,
62
  height: int = 1024,
63
  guidance_scale: float = 3,
 
64
  randomize_seed: bool = False,
65
  progress=gr.Progress(track_tqdm=True),
66
  ):
@@ -77,7 +78,7 @@ def generate(
77
  width=width,
78
  height=height,
79
  guidance_scale=guidance_scale,
80
- num_inference_steps=25,
81
  num_images_per_prompt=1,
82
  cross_attention_kwargs={"scale": 0.65},
83
  output_type="pil",
@@ -163,6 +164,13 @@ with gr.Blocks(css=css, theme="pseudolab/huggingface-korea-theme") as demo:
163
  step=0.1,
164
  value=6,
165
  )
 
 
 
 
 
 
 
166
 
167
  gr.Examples(
168
  examples=examples,
@@ -195,6 +203,7 @@ with gr.Blocks(css=css, theme="pseudolab/huggingface-korea-theme") as demo:
195
  width,
196
  height,
197
  guidance_scale,
 
198
  randomize_seed,
199
  ],
200
  outputs=[result, seed],
 
61
  width: int = 1024,
62
  height: int = 1024,
63
  guidance_scale: float = 3,
64
+ num_inference_steps = 25,
65
  randomize_seed: bool = False,
66
  progress=gr.Progress(track_tqdm=True),
67
  ):
 
78
  width=width,
79
  height=height,
80
  guidance_scale=guidance_scale,
81
+ num_inference_steps=num_inference_steps,
82
  num_images_per_prompt=1,
83
  cross_attention_kwargs={"scale": 0.65},
84
  output_type="pil",
 
164
  step=0.1,
165
  value=6,
166
  )
167
+ num_inference_steps = gr.Slider(
168
+ label="Steps",
169
+ minimum=20,
170
+ maximum=40,
171
+ step=1,
172
+ value=25,
173
+ )
174
 
175
  gr.Examples(
176
  examples=examples,
 
203
  width,
204
  height,
205
  guidance_scale,
206
+ num_inference_steps,
207
  randomize_seed,
208
  ],
209
  outputs=[result, seed],