mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
ling
ling
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
version = '2.1.703'
|
version = '2.1.704'
|
||||||
|
|||||||
@@ -400,8 +400,9 @@ def worker():
|
|||||||
|
|
||||||
pipeline.final_unet.model.diffusion_model.in_inpaint = True
|
pipeline.final_unet.model.diffusion_model.in_inpaint = True
|
||||||
|
|
||||||
# outputs.append(['results', inpaint_worker.current_task.visualize_mask_processing()])
|
if advanced_parameters.debugging_cn_preprocessor:
|
||||||
# return
|
outputs.append(['results', inpaint_worker.current_task.visualize_mask_processing()])
|
||||||
|
return
|
||||||
|
|
||||||
progressbar(13, 'VAE Inpaint encoding ...')
|
progressbar(13, 'VAE Inpaint encoding ...')
|
||||||
|
|
||||||
|
|||||||
+10
-14
@@ -335,8 +335,6 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
|
|||||||
# Disable refiner to avoid SD15 in joint swap
|
# Disable refiner to avoid SD15 in joint swap
|
||||||
final_refiner_unet = None
|
final_refiner_unet = None
|
||||||
|
|
||||||
print(f'[Sampler] refiner_swap_method = {refiner_swap_method}')
|
|
||||||
|
|
||||||
if latent is None:
|
if latent is None:
|
||||||
empty_latent = core.generate_empty_latent(width=width, height=height, batch_size=1)
|
empty_latent = core.generate_empty_latent(width=width, height=height, batch_size=1)
|
||||||
else:
|
else:
|
||||||
@@ -353,6 +351,12 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
|
|||||||
sigma_min, sigma_max, seed=image_seed, cpu=False)
|
sigma_min, sigma_max, seed=image_seed, cpu=False)
|
||||||
|
|
||||||
decoded_latent = None
|
decoded_latent = None
|
||||||
|
refiner_use_different_vae = final_refiner_vae is not None and final_refiner_unet is not None
|
||||||
|
|
||||||
|
if refiner_swap_method == 'upscale' and not refiner_use_different_vae:
|
||||||
|
refiner_swap_method = 'joint'
|
||||||
|
|
||||||
|
print(f'[Sampler] refiner_swap_method = {refiner_swap_method}')
|
||||||
|
|
||||||
if refiner_swap_method == 'joint':
|
if refiner_swap_method == 'joint':
|
||||||
sampled_latent = core.ksampler(
|
sampled_latent = core.ksampler(
|
||||||
@@ -375,14 +379,10 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
|
|||||||
decoded_latent = core.decode_vae(vae=final_vae, latent_image=sampled_latent, tiled=tiled)
|
decoded_latent = core.decode_vae(vae=final_vae, latent_image=sampled_latent, tiled=tiled)
|
||||||
|
|
||||||
if refiner_swap_method == 'upscale':
|
if refiner_swap_method == 'upscale':
|
||||||
target_model = final_refiner_unet
|
|
||||||
if target_model is None:
|
|
||||||
target_model = final_unet
|
|
||||||
|
|
||||||
sampled_latent = core.ksampler(
|
sampled_latent = core.ksampler(
|
||||||
model=target_model,
|
model=final_refiner_unet,
|
||||||
positive=clip_separate(positive_cond, target_model=target_model.model, target_clip=final_clip),
|
positive=clip_separate(positive_cond, target_model=final_refiner_unet.model, target_clip=final_clip),
|
||||||
negative=clip_separate(negative_cond, target_model=target_model.model, target_clip=final_clip),
|
negative=clip_separate(negative_cond, target_model=final_refiner_unet.model, target_clip=final_clip),
|
||||||
latent=empty_latent,
|
latent=empty_latent,
|
||||||
steps=steps, start_step=0, last_step=steps, disable_noise=False, force_full_denoise=True,
|
steps=steps, start_step=0, last_step=steps, disable_noise=False, force_full_denoise=True,
|
||||||
seed=image_seed,
|
seed=image_seed,
|
||||||
@@ -394,11 +394,7 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
|
|||||||
previewer_start=0,
|
previewer_start=0,
|
||||||
previewer_end=steps,
|
previewer_end=steps,
|
||||||
)
|
)
|
||||||
|
decoded_latent = core.decode_vae(vae=final_refiner_vae, latent_image=sampled_latent, tiled=tiled)
|
||||||
target_model = final_refiner_vae
|
|
||||||
if target_model is None:
|
|
||||||
target_model = final_vae
|
|
||||||
decoded_latent = core.decode_vae(vae=target_model, latent_image=sampled_latent, tiled=tiled)
|
|
||||||
|
|
||||||
if refiner_swap_method == 'separate':
|
if refiner_swap_method == 'separate':
|
||||||
sampled_latent = core.ksampler(
|
sampled_latent = core.ksampler(
|
||||||
|
|||||||
+13
-4
@@ -189,6 +189,15 @@ def downloading_inpaint_models(v):
|
|||||||
model_dir=inpaint_models_path,
|
model_dir=inpaint_models_path,
|
||||||
file_name='fooocus_inpaint_head.pth'
|
file_name='fooocus_inpaint_head.pth'
|
||||||
)
|
)
|
||||||
|
head_file = os.path.join(inpaint_models_path, 'fooocus_inpaint_head.pth')
|
||||||
|
patch_file = None
|
||||||
|
|
||||||
|
# load_file_from_url(
|
||||||
|
# url='https://huggingface.co/lllyasviel/Annotators/resolve/main/ControlNetLama.pth',
|
||||||
|
# model_dir=inpaint_models_path,
|
||||||
|
# file_name='ControlNetLama.pth'
|
||||||
|
# )
|
||||||
|
# lama_file = os.path.join(inpaint_models_path, 'ControlNetLama.pth')
|
||||||
|
|
||||||
if v == 'v1':
|
if v == 'v1':
|
||||||
load_file_from_url(
|
load_file_from_url(
|
||||||
@@ -196,8 +205,7 @@ def downloading_inpaint_models(v):
|
|||||||
model_dir=inpaint_models_path,
|
model_dir=inpaint_models_path,
|
||||||
file_name='inpaint.fooocus.patch'
|
file_name='inpaint.fooocus.patch'
|
||||||
)
|
)
|
||||||
return os.path.join(inpaint_models_path, 'fooocus_inpaint_head.pth'), os.path.join(inpaint_models_path,
|
patch_file = os.path.join(inpaint_models_path, 'inpaint.fooocus.patch')
|
||||||
'inpaint.fooocus.patch')
|
|
||||||
|
|
||||||
if v == 'v2.5':
|
if v == 'v2.5':
|
||||||
load_file_from_url(
|
load_file_from_url(
|
||||||
@@ -205,8 +213,9 @@ def downloading_inpaint_models(v):
|
|||||||
model_dir=inpaint_models_path,
|
model_dir=inpaint_models_path,
|
||||||
file_name='inpaint_v25.fooocus.patch'
|
file_name='inpaint_v25.fooocus.patch'
|
||||||
)
|
)
|
||||||
return os.path.join(inpaint_models_path, 'fooocus_inpaint_head.pth'), os.path.join(inpaint_models_path,
|
patch_file = os.path.join(inpaint_models_path, 'inpaint_v25.fooocus.patch')
|
||||||
'inpaint_v25.fooocus.patch')
|
|
||||||
|
return head_file, patch_file
|
||||||
|
|
||||||
|
|
||||||
def downloading_controlnet_canny():
|
def downloading_controlnet_canny():
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ with shared.gradio_root:
|
|||||||
info='Version of Fooocus inpaint model')
|
info='Version of Fooocus inpaint model')
|
||||||
|
|
||||||
with gr.Tab(label='Control Debug'):
|
with gr.Tab(label='Control Debug'):
|
||||||
debugging_cn_preprocessor = gr.Checkbox(label='Debug Preprocessor of ControlNets', value=False)
|
debugging_cn_preprocessor = gr.Checkbox(label='Debug Preprocessors', value=False)
|
||||||
|
|
||||||
mixing_image_prompt_and_vary_upscale = gr.Checkbox(label='Mixing Image Prompt and Vary/Upscale',
|
mixing_image_prompt_and_vary_upscale = gr.Checkbox(label='Mixing Image Prompt and Vary/Upscale',
|
||||||
value=False)
|
value=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user