Skip to content

Commit e9d2485

Browse files
committed
2 parents 0654180 + 8da1d3f commit e9d2485

6 files changed

Lines changed: 31 additions & 10 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @mashb1t
1+
* @lllyasviel

fooocus_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '2.5.3'
1+
version = '2.5.5'

launch.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ def ini_args():
8080
os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_device_id)
8181
print("Set device to:", args.gpu_device_id)
8282

83-
if args.hf_mirror is not None :
83+
if args.hf_mirror is not None:
8484
os.environ['HF_MIRROR'] = str(args.hf_mirror)
8585
print("Set hf_mirror to:", args.hf_mirror)
8686

8787
from modules import config
8888
from modules.hash_cache import init_cache
89+
8990
os.environ["U2NET_HOME"] = config.path_inpaint
9091

9192
os.environ['GRADIO_TEMP_DIR'] = config.temp_path
@@ -100,6 +101,8 @@ def ini_args():
100101

101102

102103
def download_models(default_model, previous_default_models, checkpoint_downloads, embeddings_downloads, lora_downloads, vae_downloads):
104+
from modules.util import get_file_from_folder_list
105+
103106
for file_name, url in vae_approx_filenames:
104107
load_file_from_url(url=url, model_dir=config.path_vae_approx, file_name=file_name)
105108

@@ -114,9 +117,9 @@ def download_models(default_model, previous_default_models, checkpoint_downloads
114117
return default_model, checkpoint_downloads
115118

116119
if not args.always_download_new_model:
117-
if not os.path.exists(os.path.join(config.paths_checkpoints[0], default_model)):
120+
if not os.path.isfile(get_file_from_folder_list(default_model, config.paths_checkpoints)):
118121
for alternative_model_name in previous_default_models:
119-
if os.path.exists(os.path.join(config.paths_checkpoints[0], alternative_model_name)):
122+
if os.path.isfile(get_file_from_folder_list(alternative_model_name, config.paths_checkpoints)):
120123
print(f'You do not have [{default_model}] but you have [{alternative_model_name}].')
121124
print(f'Fooocus will use [{alternative_model_name}] to avoid downloading new models, '
122125
f'but you are not using the latest models.')
@@ -126,11 +129,13 @@ def download_models(default_model, previous_default_models, checkpoint_downloads
126129
break
127130

128131
for file_name, url in checkpoint_downloads.items():
129-
load_file_from_url(url=url, model_dir=config.paths_checkpoints[0], file_name=file_name)
132+
model_dir = os.path.dirname(get_file_from_folder_list(file_name, config.paths_checkpoints))
133+
load_file_from_url(url=url, model_dir=model_dir, file_name=file_name)
130134
for file_name, url in embeddings_downloads.items():
131135
load_file_from_url(url=url, model_dir=config.path_embeddings, file_name=file_name)
132136
for file_name, url in lora_downloads.items():
133-
load_file_from_url(url=url, model_dir=config.paths_loras[0], file_name=file_name)
137+
model_dir = os.path.dirname(get_file_from_folder_list(file_name, config.paths_loras))
138+
load_file_from_url(url=url, model_dir=model_dir, file_name=file_name)
134139
for file_name, url in vae_downloads.items():
135140
load_file_from_url(url=url, model_dir=config.path_vae, file_name=file_name)
136141

modules/async_worker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,8 @@ def handler(async_task: AsyncTask):
12621262
height, width, _ = async_task.enhance_input_image.shape
12631263
# input image already provided, processing is skipped
12641264
steps = 0
1265+
yield_result(async_task, async_task.enhance_input_image, current_progress, async_task.black_out_nsfw, False,
1266+
async_task.disable_intermediate_results)
12651267

12661268
all_steps = steps * async_task.image_number
12671269

modules/config.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,14 @@ def init_temp_path(path: str | None, default_path: str) -> str:
520520
image_count += 1
521521
default_ip_images[image_count] = get_config_item_or_set_default(
522522
key=f'default_ip_image_{image_count}',
523-
default_value=None,
524-
validator=lambda x: x is None or isinstance(x, str) and os.path.exists(x),
523+
default_value='None',
524+
validator=lambda x: x == 'None' or isinstance(x, str) and os.path.exists(x),
525525
expected_type=str
526526
)
527+
528+
if default_ip_images[image_count] == 'None':
529+
default_ip_images[image_count] = None
530+
527531
default_ip_types[image_count] = get_config_item_or_set_default(
528532
key=f'default_ip_type_{image_count}',
529533
default_value=modules.flags.default_ip,
@@ -698,7 +702,7 @@ def init_temp_path(path: str | None, default_path: str) -> str:
698702
default_inpaint_mask_sam_model = get_config_item_or_set_default(
699703
key='default_inpaint_mask_sam_model',
700704
default_value='vit_b',
701-
validator=lambda x: x in [y[1] for y in modules.flags.inpaint_mask_sam_model if y[1] == x],
705+
validator=lambda x: x in modules.flags.inpaint_mask_sam_model,
702706
expected_type=str
703707
)
704708

update_log.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# [2.5.5](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.5)
2+
3+
* Fix colab inpaint issue by moving an import statement
4+
5+
# [2.5.4](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.4)
6+
7+
* Fix validation for default_ip_image_* and default_inpaint_mask_sam_model
8+
* Fix enhance mask debugging in combination with image sorting
9+
* Fix loading of checkpoints and LoRAs when using multiple directories in config and then switching presets
10+
111
# [2.5.3](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.3)
212

313
* Only load weights from non-safetensors files, preventing harmful code injection

0 commit comments

Comments
 (0)