From 8d67166dd1aef1993a92e4de44b664fed2769f57 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Tue, 16 Jul 2024 19:56:25 +0200 Subject: [PATCH 1/7] chore: use opencv-contrib-python-headless https://github.com/lllyasviel/Fooocus/pull/1964 (cherry picked from commit 1f32f9f4ab84f0ba450950ee15df16263f6de6d8) --- requirements_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_versions.txt b/requirements_versions.txt index 4f90e93a..9147db47 100644 --- a/requirements_versions.txt +++ b/requirements_versions.txt @@ -12,7 +12,7 @@ pytorch_lightning==2.3.3 omegaconf==2.3.0 gradio==3.41.2 pygit2==1.15.1 -opencv-contrib-python==4.10.0.84 +opencv-contrib-python-headless==4.10.0.84 httpx==0.27.0 onnxruntime==1.18.1 timm==1.0.7 From 1f429ffedaec3e568dab2234c8097688e2585c72 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Wed, 17 Jul 2024 10:30:58 +0200 Subject: [PATCH 2/7] release: bump version to 2.5.0, update changelog --- fooocus_version.py | 2 +- update_log.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fooocus_version.py b/fooocus_version.py index 5357a2e5..3d98bc1d 100644 --- a/fooocus_version.py +++ b/fooocus_version.py @@ -1 +1 @@ -version = '2.5.0-rc1' +version = '2.5.0' diff --git a/update_log.md b/update_log.md index 54d42ab5..92cc38b2 100644 --- a/update_log.md +++ b/update_log.md @@ -1,10 +1,10 @@ -# [2.5.0-rc1](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.0-rc1) +# [2.5.0](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.0) +* Update python dependencies, add segment_anything * Add enhance feature, which offers easy image refinement steps (similar to adetailer, but based on dynamic image detection instead of specific mask detection models). See [documentation](https://github.com/lllyasviel/Fooocus/discussions/3281). * Rewrite async worker code, make code much more reusable to allow iterations and improve reusability * Improve GroundingDINO and SAM image masking * Fix inference tensor version counter tracking issue for GroundingDINO after using Enhance (see [discussion](https://github.com/lllyasviel/Fooocus/discussions/3213)) -* Update python dependencies, add segment_anything * Move checkboxes Enable Mask Upload and Invert Mask When Generating from Developer Debug Mode to Inpaint Or Outpaint * Add persistent model cache for metadata. Use `--rebuild-hash-cache X` (X = int, number of CPU cores, default all) to manually rebuild the cache for all non-cached hashes * Rename `--enable-describe-uov-image` to `--enable-auto-describe-image`, now also works for enhance image upload From 9f93cf6110b859ff8c82d3f49039d82d12b37d10 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Wed, 17 Jul 2024 10:49:55 +0200 Subject: [PATCH 3/7] fix: resolve circular dependency for sha256, update files and init cache after initial model download fixes https://github.com/lllyasviel/Fooocus/issues/2372 (cherry picked from commit 5c43a4bece059a70fc6246dd01622093cac2c0c9) --- launch.py | 4 ++++ modules/config.py | 5 ----- modules/hash_cache.py | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/launch.py b/launch.py index a4609927..77c2e2c2 100644 --- a/launch.py +++ b/launch.py @@ -85,6 +85,7 @@ if args.hf_mirror is not None : print("Set hf_mirror to:", args.hf_mirror) from modules import config +from modules.hash_cache import init_cache os.environ["U2NET_HOME"] = config.path_inpaint os.environ['GRADIO_TEMP_DIR'] = config.temp_path @@ -140,4 +141,7 @@ config.default_base_model_name, config.checkpoint_downloads = download_models( config.default_base_model_name, config.previous_default_models, config.checkpoint_downloads, config.embeddings_downloads, config.lora_downloads, config.vae_downloads) +config.update_files() +init_cache(config.model_filenames, config.paths_checkpoints, config.lora_filenames, config.paths_loras) + from webui import * diff --git a/modules/config.py b/modules/config.py index 05d17843..ee867e5f 100644 --- a/modules/config.py +++ b/modules/config.py @@ -7,7 +7,6 @@ import args_manager import tempfile import modules.flags import modules.sdxl_styles -from modules.hash_cache import init_cache from modules.model_loader import load_file_from_url from modules.extra_utils import makedirs_with_log, get_files_from_folder, try_eval_env_var @@ -889,7 +888,3 @@ def downloading_sam_vit_h(): file_name='sam_vit_h_4b8939.pth' ) return os.path.join(path_sam, 'sam_vit_h_4b8939.pth') - - -update_files() -init_cache(model_filenames, paths_checkpoints, lora_filenames, paths_loras) diff --git a/modules/hash_cache.py b/modules/hash_cache.py index c33e675e..e857b003 100644 --- a/modules/hash_cache.py +++ b/modules/hash_cache.py @@ -4,8 +4,7 @@ from concurrent.futures import ThreadPoolExecutor from multiprocessing import cpu_count import args_manager -from modules.util import get_file_from_folder_list -from modules.util import sha256, HASH_SHA256_LENGTH +from modules.util import sha256, HASH_SHA256_LENGTH, get_file_from_folder_list hash_cache_filename = 'hash_cache.txt' hash_cache = {} From 4f12bbb02b1599d48c176fd6bcd25f306487a487 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Wed, 17 Jul 2024 11:37:21 +0200 Subject: [PATCH 4/7] docs: add instructions how to manually update packages, update download URL in readme --- readme.md | 2 +- update_log.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 208fc63e..39a96102 100644 --- a/readme.md +++ b/readme.md @@ -71,7 +71,7 @@ Fooocus also developed many "fooocus-only" features for advanced users to get pe You can directly download Fooocus with: -**[>>> Click here to download <<<](https://github.com/lllyasviel/Fooocus/releases/download/release/Fooocus_win64_2-1-831.7z)** +**[>>> Click here to download <<<](https://github.com/lllyasviel/Fooocus/releases/download/v2.5.0/Fooocus_win64_2-5-0.7z)** After you download the file, please uncompress it and then run the "run.bat". diff --git a/update_log.md b/update_log.md index 92cc38b2..9a0f3788 100644 --- a/update_log.md +++ b/update_log.md @@ -1,5 +1,13 @@ # [2.5.0](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.0) +This version includes various package updates. If the auto-update doesn't work you can do one of the following: +1. Open a terminal in the Fooocus folder (location of config.txt) and run `git pull` +2. Update packages + - Windows (installation through zip file): open a terminal in the Fooocus folder (location of config.txt) `..\python_embeded\python.exe -m pip install -r .\requirements_versions.txt` (Windows using embedded python, installation method zip file) or download Fooocus again (zip file attached to this release) + - other: manually update the packages using `python.exe -m pip install -r requirements_versions.txt` or use the docker image + +--- + * Update python dependencies, add segment_anything * Add enhance feature, which offers easy image refinement steps (similar to adetailer, but based on dynamic image detection instead of specific mask detection models). See [documentation](https://github.com/lllyasviel/Fooocus/discussions/3281). * Rewrite async worker code, make code much more reusable to allow iterations and improve reusability From aed3240ccdd63acca9fb2440b4828378da77e100 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Wed, 17 Jul 2024 11:45:27 +0200 Subject: [PATCH 5/7] feat: revert adding audio tab --- webui.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/webui.py b/webui.py index 2195f8cd..01ba3ac5 100644 --- a/webui.py +++ b/webui.py @@ -860,24 +860,6 @@ with shared.gradio_root: refresh_files.click(refresh_files_clicked, [], refresh_files_output + lora_ctrls, queue=False, show_progress=False) - with gr.Tab(label='Audio'): - play_notification = gr.Checkbox(label='Play notification after rendering', value=False) - notification_file = 'notification.mp3' - if os.path.exists(notification_file): - notification = gr.State(value=notification_file) - notification_input = gr.Audio(label='Notification', interactive=True, elem_id='audio_notification', visible=False, show_edit_button=False) - - def play_notification_checked(r, notification): - return gr.update(visible=r, value=notification if r else None) - - def notification_input_changed(notification_input, notification): - if notification_input: - notification = notification_input - return notification - - play_notification.change(fn=play_notification_checked, inputs=[play_notification, notification], outputs=[notification_input], queue=False) - notification_input.change(fn=notification_input_changed, inputs=[notification_input, notification], outputs=[notification], queue=False) - state_is_generating = gr.State(False) load_data_outputs = [advanced_checkbox, image_number, prompt, negative_prompt, style_selections, @@ -1045,6 +1027,11 @@ with shared.gradio_root: progress_html, progress_window, progress_gallery, gallery], queue=False) + for notification_file in ['notification.ogg', 'notification.mp3']: + if os.path.exists(notification_file): + gr.Audio(interactive=False, value=notification_file, elem_id='audio_notification', visible=False) + break + def trigger_describe(mode, img): if mode == flags.desc_type_photo: from extras.interrogate import default_interrogator as default_interrogator_photo From 033cb90e6e31a0145bcf7e724c1ad66bc3400755 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Wed, 17 Jul 2024 11:52:20 +0200 Subject: [PATCH 6/7] feat: revert adding issue templates --- .github/ISSUE_TEMPLATE/bug_report.yaml | 77 --------------------- .github/ISSUE_TEMPLATE/feature_request.yaml | 34 --------- 2 files changed, 111 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml deleted file mode 100644 index 58c983fe..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ /dev/null @@ -1,77 +0,0 @@ -name: Bug Report -description: Describe a problem -title: "[Bug]: " -labels: ["bug", "triage"] -body: - - type: markdown - attributes: - value: | - Thank you for taking the time to fill out this bug report form! - - type: checkboxes - id: prerequisites - attributes: - label: Prerequisites - description: Please make sure to troubleshoot yourself before continuing. - options: - - label: I have read the [Troubleshooting Guide](https://github.com/lllyasviel/Fooocus/blob/main/troubleshoot.md) - required: true - - label: I have checked that this is not a duplicate of an already existing [issue](https://github.com/lllyasviel/Fooocus/issues) - required: true - - type: textarea - id: description - attributes: - label: Describe the problem - description: Also tell us, what did you expect to happen? - placeholder: "A clear and concise description of what the bug is." - validations: - required: true - - type: textarea - id: logs - attributes: - label: Full console log output - description: Please copy and paste the **full** console log here. You will make our job easier if you give a **full** log. This will be automatically formatted into code, so no need for backticks. - render: shell - validations: - required: true - - type: textarea - id: version - attributes: - label: Version - description: What version of Fooocus are you using? (see browser tab title or console log) - placeholder: "Example: Fooocus 2.1.855" - validations: - required: true - - type: dropdown - id: hosting - attributes: - label: Where are you running Fooocus? - multiple: false - options: - - Locally - - Locally with virtualisation (e.g. Docker) - - Cloud (Gradio) - - Cloud (other) - validations: - required: true - - type: input - id: operating-system - attributes: - label: Operating System - description: What operating system are you using? - placeholder: "Example: Windows 10" - - type: dropdown - id: browsers - attributes: - label: What browsers are you seeing the problem on? - multiple: true - options: - - Chrome - - Firefox - - Microsoft Edge - - Safari - - other - validations: - required: true - - type: markdown - attributes: - value: "Thank you for completing our form!" diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml deleted file mode 100644 index 3295902a..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: Feature request -description: Suggest an idea for this project -title: "[Feature]: " -labels: ["enhancement"] -body: - - type: markdown - attributes: - value: | - Thank you for taking the time to fill out this feature request form! - - type: checkboxes - id: prerequisites - attributes: - label: Prerequisites - options: - - label: I have checked that this is not a duplicate of an already existing [feature request](https://github.com/lllyasviel/Fooocus/issues) - required: true - - type: textarea - id: relation-to-problem - attributes: - label: Is your feature request related to a problem? Please describe. - placeholder: "A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -." - validations: - required: true - - type: textarea - id: description - attributes: - label: Describe the idea you'd like - placeholder: "A clear and concise description of what you want to happen." - validations: - required: true - - type: markdown - attributes: - value: "Thank you for completing our form!" From 97a8475a623e57c515ceaba51b4b6ef8bef8c004 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Wed, 17 Jul 2024 11:59:01 +0200 Subject: [PATCH 7/7] feat: revert disabling persistent style sorting, code cleanup --- modules/meta_parser.py | 1 - modules/style_sorter.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/modules/meta_parser.py b/modules/meta_parser.py index ac0dff38..14f85835 100644 --- a/modules/meta_parser.py +++ b/modules/meta_parser.py @@ -9,7 +9,6 @@ from PIL import Image import fooocus_version import modules.config import modules.sdxl_styles -from modules import hash_cache from modules.flags import MetadataScheme, Performance, Steps from modules.flags import SAMPLERS, CIVITAI_NO_KARRAS from modules.hash_cache import sha256_from_cache diff --git a/modules/style_sorter.py b/modules/style_sorter.py index 5cab89fc..49142bc7 100644 --- a/modules/style_sorter.py +++ b/modules/style_sorter.py @@ -37,7 +37,6 @@ def sort_styles(selected): global all_styles unselected = [y for y in all_styles if y not in selected] sorted_styles = selected + unselected - """ try: with open('sorted_styles.json', 'wt', encoding='utf-8') as fp: json.dump(sorted_styles, fp, indent=4) @@ -45,7 +44,6 @@ def sort_styles(selected): print('Write style sorting failed.') print(e) all_styles = sorted_styles - """ return gr.CheckboxGroup.update(choices=sorted_styles)