This commit is contained in:
lllyasviel 2023-10-03 16:08:06 -07:00 committed by GitHub
parent 80632d5eb3
commit 6c56b580d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 7 deletions

View File

@ -1 +1 @@
version = '2.0.83'
version = '2.0.84'

View File

@ -47,7 +47,7 @@ def worker():
execution_start_time = time.perf_counter()
prompt, negative_prompt, style_selections, performance_selction, \
aspect_ratios_selction, image_number, image_seed, sharpness, adm_scaler_positive, adm_scaler_negative, guidance_scale, adaptive_cfg, sampler_name, \
aspect_ratios_selction, image_number, image_seed, sharpness, adm_scaler_positive, adm_scaler_negative, guidance_scale, adaptive_cfg, sampler_name, scheduler_name, \
base_model_name, refiner_model_name, \
l1, w1, l2, w2, l3, w3, l4, w4, l5, w5, \
input_image_checkbox, current_tab, \
@ -241,7 +241,7 @@ def worker():
sampler_name = 'dpmpp_fooocus_2m_sde_inpaint_seamless'
print(f'[Parameters] Sampler = {sampler_name}')
print(f'[Parameters] Sampler = {sampler_name} - {scheduler_name}')
progressbar(1, 'Initializing ...')
@ -360,6 +360,7 @@ def worker():
image_seed=task['task_seed'],
callback=callback,
sampler_name=sampler_name,
scheduler_name=scheduler_name,
latent=initial_latent,
denoise=denoising_strength,
tiled=tiled,
@ -383,6 +384,7 @@ def worker():
('Base Model', base_model_name),
('Refiner Model', refiner_model_name),
('Sampler', sampler_name),
('Scheduler', scheduler_name),
('Seed', task['task_seed'])
]
for n, w in loras_user_raw_input:

View File

@ -198,7 +198,7 @@ expansion = FooocusExpansion()
@torch.no_grad()
@torch.inference_mode()
def process_diffusion(positive_cond, negative_cond, steps, switch, width, height, image_seed, callback, sampler_name, latent=None, denoise=1.0, tiled=False, cfg_scale=7.0):
def process_diffusion(positive_cond, negative_cond, steps, switch, width, height, image_seed, callback, sampler_name, scheduler_name, latent=None, denoise=1.0, tiled=False, cfg_scale=7.0):
if latent is None:
empty_latent = core.generate_empty_latent(width=width, height=height, batch_size=1)
else:
@ -219,7 +219,8 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
denoise=denoise,
callback_function=callback,
cfg=cfg_scale,
sampler_name=sampler_name
sampler_name=sampler_name,
scheduler=scheduler_name
)
else:
sampled_latent = core.ksampler(
@ -232,7 +233,8 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
denoise=denoise,
callback_function=callback,
cfg=cfg_scale,
sampler_name=sampler_name
sampler_name=sampler_name,
scheduler=scheduler_name
)
decoded_latent = core.decode_vae(vae=xl_base_patched.vae, latent_image=sampled_latent, tiled=tiled)

View File

@ -18,3 +18,6 @@ sampler_list = ["euler", "euler_ancestral", "heun", "dpm_2", "dpm_2_ancestral",
# "dpmpp_fooocus_2m_sde_inpaint_seamless"
]
default_sampler = 'dpmpp_2m_sde_gpu'
scheduler_list = ["normal", "karras", "exponential", "sgm_uniform", "simple", "ddim_uniform"]
default_scheduler = "karras"

View File

@ -169,6 +169,7 @@ with shared.gradio_root:
info='Enabling Fooocus\'s implementation of CFG mimicking for TSNR '
'(effective when real CFG > mimicked CFG).')
sampler_name = gr.Dropdown(label='Sampler', choices=flags.sampler_list, value=flags.default_sampler, info='Only effective in non-inpaint mode.')
scheduler_name = gr.Dropdown(label='Scheduler', choices=flags.scheduler_list, value=flags.default_scheduler, info='Scheduler of Sampler.')
def dev_mode_checked(r):
return gr.update(visible=r)
@ -189,7 +190,7 @@ with shared.gradio_root:
advanced_checkbox.change(lambda x: gr.update(visible=x), advanced_checkbox, right_col, queue=False)
ctrls = [
prompt, negative_prompt, style_selections,
performance_selction, aspect_ratios_selction, image_number, image_seed, sharpness, adm_scaler_positive, adm_scaler_negative, guidance_scale, adaptive_cfg, sampler_name
performance_selction, aspect_ratios_selction, image_number, image_seed, sharpness, adm_scaler_positive, adm_scaler_negative, guidance_scale, adaptive_cfg, sampler_name, scheduler_name
]
ctrls += [base_model, refiner_model] + lora_ctrls
ctrls += [input_image_checkbox, current_tab]