Merge branch 'feature/add-pony-support-and-preset' into develop
# Conflicts: # webui.py
This commit is contained in:
commit
dbbe42ed30
|
|
@ -469,6 +469,12 @@ default_inpaint_engine_version = get_config_item_or_set_default(
|
|||
validator=lambda x: x in modules.flags.inpaint_engine_versions,
|
||||
expected_type=str
|
||||
)
|
||||
default_inpaint_method = get_config_item_or_set_default(
|
||||
key='default_inpaint_method',
|
||||
default_value=modules.flags.inpaint_option_default,
|
||||
validator=lambda x: x in modules.flags.inpaint_options,
|
||||
expected_type=str
|
||||
)
|
||||
default_cfg_tsnr = get_config_item_or_set_default(
|
||||
key='default_cfg_tsnr',
|
||||
default_value=7.0,
|
||||
|
|
@ -634,7 +640,8 @@ possible_preset_keys = {
|
|||
"checkpoint_downloads": "checkpoint_downloads",
|
||||
"embeddings_downloads": "embeddings_downloads",
|
||||
"lora_downloads": "lora_downloads",
|
||||
"default_vae": "vae"
|
||||
"default_vae": "vae",
|
||||
"default_inpaint_method": "inpaint_method"
|
||||
}
|
||||
|
||||
REWRITE_PRESET = False
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ def load_parameter_button_click(raw_metadata: dict | str, is_generating: bool):
|
|||
get_str('scheduler', 'Scheduler', loaded_parameter_dict, results)
|
||||
get_str('vae', 'VAE', loaded_parameter_dict, results)
|
||||
get_seed('seed', 'Seed', loaded_parameter_dict, results)
|
||||
get_inpaint_method('inpaint_method', 'Inpaint Mode', loaded_parameter_dict, results)
|
||||
|
||||
if is_generating:
|
||||
results.append(gr.update())
|
||||
|
|
@ -160,6 +161,17 @@ def get_seed(key: str, fallback: str | None, source_dict: dict, results: list, d
|
|||
results.append(gr.update())
|
||||
|
||||
|
||||
def get_inpaint_method(key: str, fallback: str | None, source_dict: dict, results: list, default=None) -> str | None:
|
||||
try:
|
||||
h = source_dict.get(key, source_dict.get(fallback, default))
|
||||
assert isinstance(h, str) and h in modules.flags.inpaint_options
|
||||
results.append(h)
|
||||
return h
|
||||
except:
|
||||
results.append(gr.update())
|
||||
return None
|
||||
|
||||
|
||||
def get_adm_guidance(key: str, fallback: str | None, source_dict: dict, results: list, default=None):
|
||||
try:
|
||||
h = source_dict.get(key, source_dict.get(fallback, default))
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@
|
|||
"Fooocus V2"
|
||||
],
|
||||
"default_aspect_ratio": "1024*1024",
|
||||
"default_overwrite_step": -1,
|
||||
"default_inpaint_method": "Improve Detail (face, hand, eyes, etc.)",
|
||||
"checkpoint_downloads": {
|
||||
"playground-v2.5-1024px-aesthetic.fp16.safetensors": "https://huggingface.co/mashb1t/fav_models/resolve/main/fav/playground-v2.5-1024px-aesthetic.fp16.safetensors"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
],
|
||||
"default_aspect_ratio": "896*1152",
|
||||
"default_overwrite_step": -1,
|
||||
"default_inpaint_method": "Improve Detail (face, hand, eyes, etc.)",
|
||||
"checkpoint_downloads": {
|
||||
"ponyDiffusionV6XL.safetensors": "https://huggingface.co/mashb1t/fav_models/resolve/main/fav/ponyDiffusionV6XL.safetensors"
|
||||
},
|
||||
|
|
|
|||
14
webui.py
14
webui.py
|
|
@ -235,7 +235,7 @@ with shared.gradio_root:
|
|||
with gr.Column():
|
||||
inpaint_input_image = grh.Image(label='Image', source='upload', type='numpy', tool='sketch', height=500, brush_color="#FFFFFF", elem_id='inpaint_canvas', show_label=False)
|
||||
inpaint_advanced_masking_checkbox = gr.Checkbox(label='Enable Advanced Masking Features', value=False)
|
||||
inpaint_mode = gr.Dropdown(choices=modules.flags.inpaint_options, value=modules.flags.inpaint_option_default, label='Method')
|
||||
inpaint_mode = gr.Dropdown(choices=modules.flags.inpaint_options, value=modules.config.default_inpaint_method, label='Method')
|
||||
inpaint_additional_prompt = gr.Textbox(placeholder="Describe what you want to inpaint.", elem_id='inpaint_additional_prompt', label='Inpaint Additional Prompt', visible=False)
|
||||
outpaint_selections = gr.CheckboxGroup(choices=['Left', 'Right', 'Top', 'Bottom'], value=[], label='Outpaint Direction')
|
||||
example_inpaint_prompts = gr.Dataset(samples=modules.config.example_inpaint_prompts,
|
||||
|
|
@ -874,7 +874,8 @@ with shared.gradio_root:
|
|||
overwrite_width, overwrite_height, guidance_scale, sharpness, adm_scaler_positive,
|
||||
adm_scaler_negative, adm_scaler_end, refiner_swap_method, adaptive_cfg, clip_skip,
|
||||
base_model, refiner_model, refiner_switch, sampler_name, scheduler_name, vae_name,
|
||||
seed_random, image_seed, generate_button, load_parameter_button] + freeu_ctrls + lora_ctrls
|
||||
seed_random, image_seed, inpaint_mode, generate_button, load_parameter_button
|
||||
] + freeu_ctrls + lora_ctrls
|
||||
|
||||
if not args_manager.args.disable_preset_selection:
|
||||
def preset_selection_change(preset, is_generating):
|
||||
|
|
@ -917,7 +918,14 @@ with shared.gradio_root:
|
|||
queue=False, show_progress=False) \
|
||||
.then(fn=lambda: None, _js='refresh_grid_delayed', queue=False, show_progress=False)
|
||||
|
||||
inpaint_mode.input(inpaint_mode_change, inputs=inpaint_mode, outputs=[
|
||||
inpaint_mode.change(inpaint_mode_change, inputs=inpaint_mode, outputs=[
|
||||
inpaint_additional_prompt, outpaint_selections, example_inpaint_prompts,
|
||||
inpaint_disable_initial_latent, inpaint_engine,
|
||||
inpaint_strength, inpaint_respective_field
|
||||
], show_progress=False, queue=False)
|
||||
|
||||
# load configured default_inpaint_method
|
||||
shared.gradio_root.load(inpaint_mode_change, inputs=inpaint_mode, outputs=[
|
||||
inpaint_additional_prompt, outpaint_selections, example_inpaint_prompts,
|
||||
inpaint_disable_initial_latent, inpaint_engine,
|
||||
inpaint_strength, inpaint_respective_field
|
||||
|
|
|
|||
Loading…
Reference in New Issue