Skip to content

Commit 1068d3f

Browse files
authored
Merge pull request lllyasviel#3499 from lllyasviel/develop
Release 2.5.4
2 parents fd74b57 + 082a526 commit 1068d3f

4 files changed

Lines changed: 18 additions & 6 deletions

File tree

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.4'

launch.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from build_launcher import build_launcher
2222
from modules.launch_util import is_installed, run, python, run_pip, requirements_met, delete_folder_content
2323
from modules.model_loader import load_file_from_url
24+
from modules.util import get_file_from_folder_list
2425

2526
REINSTALL_ALL = False
2627
TRY_INSTALL_XFORMERS = False
@@ -80,12 +81,13 @@ def ini_args():
8081
os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_device_id)
8182
print("Set device to:", args.gpu_device_id)
8283

83-
if args.hf_mirror is not None :
84+
if args.hf_mirror is not None:
8485
os.environ['HF_MIRROR'] = str(args.hf_mirror)
8586
print("Set hf_mirror to:", args.hf_mirror)
8687

8788
from modules import config
8889
from modules.hash_cache import init_cache
90+
8991
os.environ["U2NET_HOME"] = config.path_inpaint
9092

9193
os.environ['GRADIO_TEMP_DIR'] = config.temp_path
@@ -114,9 +116,9 @@ def download_models(default_model, previous_default_models, checkpoint_downloads
114116
return default_model, checkpoint_downloads
115117

116118
if not args.always_download_new_model:
117-
if not os.path.exists(os.path.join(config.paths_checkpoints[0], default_model)):
119+
if not os.path.isfile(get_file_from_folder_list(default_model, config.paths_checkpoints)):
118120
for alternative_model_name in previous_default_models:
119-
if os.path.exists(os.path.join(config.paths_checkpoints[0], alternative_model_name)):
121+
if os.path.isfile(get_file_from_folder_list(alternative_model_name, config.paths_checkpoints)):
120122
print(f'You do not have [{default_model}] but you have [{alternative_model_name}].')
121123
print(f'Fooocus will use [{alternative_model_name}] to avoid downloading new models, '
122124
f'but you are not using the latest models.')
@@ -126,11 +128,13 @@ def download_models(default_model, previous_default_models, checkpoint_downloads
126128
break
127129

128130
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)
131+
model_dir = os.path.dirname(get_file_from_folder_list(file_name, config.paths_checkpoints))
132+
load_file_from_url(url=url, model_dir=model_dir, file_name=file_name)
130133
for file_name, url in embeddings_downloads.items():
131134
load_file_from_url(url=url, model_dir=config.path_embeddings, file_name=file_name)
132135
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)
136+
model_dir = os.path.dirname(get_file_from_folder_list(file_name, config.paths_loras))
137+
load_file_from_url(url=url, model_dir=model_dir, file_name=file_name)
134138
for file_name, url in vae_downloads.items():
135139
load_file_from_url(url=url, model_dir=config.path_vae, file_name=file_name)
136140

modules/async_worker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,8 @@ def handler(async_task: AsyncTask):
12231223
height, width, _ = async_task.enhance_input_image.shape
12241224
# input image already provided, processing is skipped
12251225
steps = 0
1226+
yield_result(async_task, async_task.enhance_input_image, current_progress, async_task.black_out_nsfw, False,
1227+
async_task.disable_intermediate_results)
12261228

12271229
all_steps = steps * async_task.image_number
12281230

update_log.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# [2.5.4](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.4)
2+
3+
* Fix validation for default_ip_image_* and default_inpaint_mask_sam_model
4+
* Fix enhance mask debugging in combination with image sorting
5+
* Fix loading of checkpoints and LoRAs when using multiple directories in config and then switching presets
6+
17
# [2.5.3](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.3)
28

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

0 commit comments

Comments
 (0)