multimodalart HF Staff commited on
Commit
8566172
·
verified ·
1 Parent(s): 1aaa50c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -81,6 +81,11 @@ DEFAULT_STEPS = {
81
  "Regular (30 steps)": 30,
82
  }
83
 
 
 
 
 
 
84
 
85
  def image_to_data_uri(img):
86
  buffered = io.BytesIO()
@@ -161,7 +166,7 @@ def update_dimensions_from_image(image_list):
161
 
162
  def update_steps_from_mode(mode_choice):
163
  """Update the number of inference steps based on the selected mode."""
164
- return DEFAULT_STEPS[mode_choice]
165
 
166
 
167
  @spaces.GPU(duration=85)
@@ -317,7 +322,7 @@ FLUX.2 [Klein] is a... [[model](https://huggingface.co/black-forest-labs/FLUX.2-
317
  minimum=0.0,
318
  maximum=10.0,
319
  step=0.1,
320
- value=4.0,
321
  )
322
 
323
 
@@ -354,7 +359,7 @@ FLUX.2 [Klein] is a... [[model](https://huggingface.co/black-forest-labs/FLUX.2-
354
  mode_choice.change(
355
  fn=update_steps_from_mode,
356
  inputs=[mode_choice],
357
- outputs=[num_inference_steps]
358
  )
359
 
360
  gr.on(
 
81
  "Regular (30 steps)": 30,
82
  }
83
 
84
+ # Default CFG for each mode
85
+ DEFAULT_CFG = {
86
+ "Distilled (4 steps)": 1.0,
87
+ "Regular (30 steps)": 4.0,
88
+ }
89
 
90
  def image_to_data_uri(img):
91
  buffered = io.BytesIO()
 
166
 
167
  def update_steps_from_mode(mode_choice):
168
  """Update the number of inference steps based on the selected mode."""
169
+ return DEFAULT_STEPS[mode_choice], DEFAULT_CFG[mode_choice]
170
 
171
 
172
  @spaces.GPU(duration=85)
 
322
  minimum=0.0,
323
  maximum=10.0,
324
  step=0.1,
325
+ value=1.0,
326
  )
327
 
328
 
 
359
  mode_choice.change(
360
  fn=update_steps_from_mode,
361
  inputs=[mode_choice],
362
+ outputs=[num_inference_steps, guidance_scale]
363
  )
364
 
365
  gr.on(