Fabrice-TIERCELIN commited on
Commit
a282bf5
1 Parent(s): f8b8c3b

Default values

Browse files
Files changed (1) hide show
  1. gradio_demo.py +6 -3
gradio_demo.py CHANGED
@@ -156,6 +156,9 @@ def stage2_process(input_image, prompt, a_prompt, n_prompt, num_samples, upscale
156
 
157
 
158
  def load_and_reset(param_setting):
 
 
 
159
  edm_steps = default_setting.edm_steps
160
  s_stage2 = 1.0
161
  s_stage1 = -1.0
@@ -250,9 +253,9 @@ with block:
250
  num_samples = gr.Slider(label="Num Samples", minimum=1, maximum=4 if not args.use_image_slider else 1
251
  , value=1, step=1)
252
  upscale = gr.Slider(label="Upscale", minimum=1, maximum=8, value=1, step=1)
253
- edm_steps = gr.Slider(label="Steps", minimum=1, maximum=200, value=default_setting.edm_steps, step=1)
254
  s_cfg = gr.Slider(label="Text Guidance Scale", minimum=1.0, maximum=15.0,
255
- value=default_setting.s_cfg_Quality, step=0.1)
256
  s_stage2 = gr.Slider(label="Stage2 Guidance Strength", minimum=0., maximum=1., value=1., step=0.05)
257
  s_stage1 = gr.Slider(label="Stage1 Guidance Strength", minimum=-1.0, maximum=6.0, value=-1.0, step=1.0)
258
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
@@ -272,7 +275,7 @@ with block:
272
  with gr.Column():
273
  linear_CFG = gr.Checkbox(label="Linear CFG", value=True)
274
  spt_linear_CFG = gr.Slider(label="CFG Start", minimum=1.0,
275
- maximum=9.0, value=default_setting.spt_linear_CFG_Quality, step=0.5)
276
  with gr.Column():
277
  linear_s_stage2 = gr.Checkbox(label="Linear Stage2 Guidance", value=False)
278
  spt_linear_s_stage2 = gr.Slider(label="Guidance Start", minimum=0.,
 
156
 
157
 
158
  def load_and_reset(param_setting):
159
+ if torch.cuda.device_count() == 0:
160
+ gr.Warning('Set this space to GPU config to make it work.')
161
+ return None, None, None, None, None, None, None, None, None, None, None, None, None
162
  edm_steps = default_setting.edm_steps
163
  s_stage2 = 1.0
164
  s_stage1 = -1.0
 
253
  num_samples = gr.Slider(label="Num Samples", minimum=1, maximum=4 if not args.use_image_slider else 1
254
  , value=1, step=1)
255
  upscale = gr.Slider(label="Upscale", minimum=1, maximum=8, value=1, step=1)
256
+ edm_steps = gr.Slider(label="Steps", minimum=1, maximum=200, value=default_setting.edm_steps if torch.cuda.device_count() > 0 else 1, step=1)
257
  s_cfg = gr.Slider(label="Text Guidance Scale", minimum=1.0, maximum=15.0,
258
+ value=default_setting.s_cfg_Quality if torch.cuda.device_count() > 0 else 1.0, step=0.1)
259
  s_stage2 = gr.Slider(label="Stage2 Guidance Strength", minimum=0., maximum=1., value=1., step=0.05)
260
  s_stage1 = gr.Slider(label="Stage1 Guidance Strength", minimum=-1.0, maximum=6.0, value=-1.0, step=1.0)
261
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
 
275
  with gr.Column():
276
  linear_CFG = gr.Checkbox(label="Linear CFG", value=True)
277
  spt_linear_CFG = gr.Slider(label="CFG Start", minimum=1.0,
278
+ maximum=9.0, value=default_setting.spt_linear_CFG_Quality if torch.cuda.device_count() > 0 else 1.0, step=0.5)
279
  with gr.Column():
280
  linear_s_stage2 = gr.Checkbox(label="Linear Stage2 Guidance", value=False)
281
  spt_linear_s_stage2 = gr.Slider(label="Guidance Start", minimum=0.,