frogleo commited on
Commit
07e3db2
·
1 Parent(s): 4cce1bb

优化命名

Browse files
__pycache__/config.cpython-310.pyc CHANGED
Binary files a/__pycache__/config.cpython-310.pyc and b/__pycache__/config.cpython-310.pyc differ
 
__pycache__/utils.cpython-310.pyc CHANGED
Binary files a/__pycache__/utils.cpython-310.pyc and b/__pycache__/utils.cpython-310.pyc differ
 
app.py CHANGED
@@ -102,8 +102,8 @@ def generate(
102
  width: int,
103
  height: int,
104
  scheduler: str,
105
- upscaler_strength:float,
106
- upscale_by:float,
107
  seed: int,
108
  randomize_seed: bool,
109
  guidance_scale: float,
@@ -123,7 +123,7 @@ def generate(
123
  progress(progress_value, desc=f"Image generating, {step + 1}/{num_inference_steps} steps")
124
  return callback_kwargs
125
 
126
- optimizing_steps = int(num_inference_steps * upscaler_strength)
127
  def callback2(pipe, step, timestep, callback_kwargs):
128
  progress_value = 0.6 + ((step+1.0)/optimizing_steps)*(0.4/1.0)
129
  progress(progress_value, desc=f"Image optimizing, {step + 1}/{optimizing_steps} steps")
@@ -164,14 +164,14 @@ def generate(
164
  output_type="latent",
165
  callback_on_step_end=callback1
166
  ).images
167
- upscaled_latents = utils.upscale(latents, "nearest-exact", upscale_by)
168
  images = upscaler_pipe(
169
  prompt=prompt,
170
  negative_prompt=negative_prompt,
171
  image=upscaled_latents,
172
  guidance_scale=guidance_scale,
173
  num_inference_steps=num_inference_steps,
174
- strength=upscaler_strength,
175
  generator=generator,
176
  output_type="pil",
177
  callback_on_step_end=callback2
@@ -254,15 +254,15 @@ with gr.Blocks(css=custom_css).queue() as demo:
254
  value=1216,
255
  )
256
  with gr.Row():
257
- upscaler_strength = gr.Slider(
258
- label="Upscaler strength",
259
  minimum=0,
260
  maximum=1,
261
  step=0.05,
262
  value=0.55,
263
  )
264
- upscale_by = gr.Slider(
265
- label="Upscale",
266
  minimum=1,
267
  maximum=1.5,
268
  step=0.1,
@@ -314,7 +314,7 @@ with gr.Blocks(css=custom_css).queue() as demo:
314
  prompt, negative_prompt,
315
  width, height,
316
  scheduler,
317
- upscaler_strength,upscale_by,
318
  seed,randomize_seed,
319
  guidance_scale,num_inference_steps
320
  ],
 
102
  width: int,
103
  height: int,
104
  scheduler: str,
105
+ opt_strength:float,
106
+ opt_scale:float,
107
  seed: int,
108
  randomize_seed: bool,
109
  guidance_scale: float,
 
123
  progress(progress_value, desc=f"Image generating, {step + 1}/{num_inference_steps} steps")
124
  return callback_kwargs
125
 
126
+ optimizing_steps = int(num_inference_steps * opt_strength)
127
  def callback2(pipe, step, timestep, callback_kwargs):
128
  progress_value = 0.6 + ((step+1.0)/optimizing_steps)*(0.4/1.0)
129
  progress(progress_value, desc=f"Image optimizing, {step + 1}/{optimizing_steps} steps")
 
164
  output_type="latent",
165
  callback_on_step_end=callback1
166
  ).images
167
+ upscaled_latents = utils.upscale(latents, "nearest-exact", opt_scale)
168
  images = upscaler_pipe(
169
  prompt=prompt,
170
  negative_prompt=negative_prompt,
171
  image=upscaled_latents,
172
  guidance_scale=guidance_scale,
173
  num_inference_steps=num_inference_steps,
174
+ strength=opt_strength,
175
  generator=generator,
176
  output_type="pil",
177
  callback_on_step_end=callback2
 
254
  value=1216,
255
  )
256
  with gr.Row():
257
+ optimization_strength = gr.Slider(
258
+ label="Optimization strength",
259
  minimum=0,
260
  maximum=1,
261
  step=0.05,
262
  value=0.55,
263
  )
264
+ optimization_scale = gr.Slider(
265
+ label="Optimization scale ratio",
266
  minimum=1,
267
  maximum=1.5,
268
  step=0.1,
 
314
  prompt, negative_prompt,
315
  width, height,
316
  scheduler,
317
+ optimization_strength,optimization_scale,
318
  seed,randomize_seed,
319
  guidance_scale,num_inference_steps
320
  ],