The purpose of this fork is to add new features / fix bugs and contribute back to Fooocus.
As a collaborator & contributor of the Fooocus repository you can find me in almost every issue, pull request, discussion etc.
Sadly the creator of Fooocus has gone dark multiple times for an extended amount of time, which is why I took matters into my own hands.
(mostly a reflection of my PRs)
- β¨ lllyasviel#958 - NSFW image censoring (config and UI)
- π lllyasviel#981 - prevent users from skipping/stopping other users tasks in queue (multi-user capabilities) + rework advanced_parameters (removal + PID handling)
- β¨ lllyasviel#985 - add list of 100 animals to wildcards
- β¨ lllyasviel#1013 - add advanced parameter for disable_intermediate_results (progress_gallery, prevents UI lag when generation is too fast)
- β¨ lllyasviel#1039 - add prompt translation
- β¨ lllyasviel#1043 - add lcm realtime canvas painting (not merged to main in this repository)
- β¨
lllyasviel#1167 - update model BluePencil XL v0.5 to v3.1.0 - β¨ lllyasviel#1570 - add preset selection to Gradio UI (session based)
- π
lllyasviel#1578 - add workaround for changing prompt while generating - β¨ lllyasviel#1580 - add preset for SDXL Turbo (model DreamShaperXL_Turbo)
- β¨
lllyasviel#1616 - add config setting for default_max_image_number - π lllyasviel#1668 - fix path_outputs directory creation if it doesn't exist
- β¨ show more details for each performance setting, e.g. steps
- β¨ add default_overwrite_step handling for meta data and gradio (allows turbo preset switching to set default_overwrite_step correctly)
- β¨
lllyasviel#1762 - add style preview on mouseover - π
lllyasviel#1784 - correctly sort files, display deepest directory level first - β¨
lllyasviel#1785 - update model Juggernaut XL v6 to v8 - β¨ lllyasviel#1809 - reduce file size of preview images
- β¨ lllyasviel#1932 - use consistent file name in gradio
- β¨ lllyasviel#1863 - image extension support (png, jpg, webp)
- β¨ lllyasviel#1938 - automatically describe image on uov image upload if prompt is empty
- β¨ lllyasviel#1940 - meta data handling, schemes: Fooocus (json) and A1111 (plain text). Compatible with Civitai.
- β¨
lllyasviel#1979 - prevent outdated history log link after midnight - β¨ lllyasviel#2032 - add inpaint mask generation functionality using rembg, incl. segmentation support
β¨ = new feature
π = bugfix
abc = merged
lllyasviel#1570 - Preset Selection
No need to restart your browser to change a preset ever again. Combined with total user isolation, every user can now set and use any preset they desire. You can even reload your presets in the browser if you've changed them.
lllyasviel#2032 - Automated Mask Generation + Mask Prompting
299776543-696b97e8-bc05-4d52-86f6-0f1693a7dd25.mp4
Videos by @rayronvictor
Mask generation by cloth category
299493287-5a030d4e-280e-46cb-a8b1-50d264a70d2d.mp4
Mask generation by prompt
299776543-696b97e8-bc05-4d52-86f6-0f1693a7dd25.mp4
lllyasviel#1940 - Metadata Handling - Compatible with Civitai & A1111
This feature offers activatable metadata persistency in images for both a Fooocus (json) and A1111 (plain text) meta data scheme, where the latter is 100% compatible with A1111 and Civitai, but can not be used to reproduce the image outside of Fooocus, as there are so many improvements and special things happening in Fooocus it's just not applicable anywhere else.
- Supports metadata for PNG (PngInfo) + JPG and WebP (both EXIF).
- Save & restore configurations directly from images
- You can also configure a copyright / creator tag
Config options
"default_save_metadata_to_images": true,
"default_metadata_scheme": "a1111",
"metadata_created_by": "mashb1t"
Arg --disable-metadata
--disable-metadata
completely prevents metadata processing and output in Gradio
Metadata Reader
- open Image Input > Metadata tab
- drag & Drop image to image upload
- automatic preview of image metadata
- apply metadata to Gradio inputs on button click
Metadata in files
LCM A1111 scheme (yes, with negative prompt, because it technically exists but doesn't have an influence)
This is a fork of Fooocus. This fork integrates the following:
- Insightface/inswapper library used by roop, ReActor, and others
- PhotoMaker based on
π€ diffusers
- InstantID based on
π€ diffusers
The goal of this repository is to stay up-to-date with the main repository, while also maintaining the above integrations.
For more detailed and official documentation, please refer to lllyasviel's repository.
A standalone installation does not exist for this repository.
The installation assumes CUDA 11.8. If you need a different version, please update configure.bat
with the correct URL to the desired CUDA version.
- Run
git clone https://github.com/machineminded/Fooocus-inswapper.git
- Execute
configure.bat
Inswapper will activate if "Input Image" and "Enabled" are both checked.
.\venv\Scripts\activate
python launch.py
usage.mp4
In this fork, PhotoMaker utilizes π€ diffusers
, so it runs outside of the ksampler pipelines. I'd like to eventually add inpainting and ControlNet for π€ diffusers
but it will take some time. Keep in mind that PhotoMaker currently requires 15GB of VRAM! The following Fooocus configuration items are passed to the PhotoMaker π€ diffusers
pipeline:
- Resolution (width and height)
- Prompt (and generated prompts from selected styles)
- Negative Prompt (and generated prompts from selected styles)
- Steps
- CFG/Guidance Scale
- Seed
- LoRAs
- Sampler (not fully implemented)
- Scheduler (not fully implemented)
- Navigate to the PhotoMaker tab.
- Click "Enable"
- Load images from your PC.
- Enter your prompt and be sure to include "man img" or "woman img" depending on the subject at hand. img in the prompt is expected by PhotoMaker.
- Click "Generate"
Experiment with also adding an image to the Inswapper tab to overlay the generated image.
Note: Unchecking "Enable" will unload the PhotoMaker pipeline from memory!
- Select the LoRAs you want to use as usual.
- Navigate to the PhotoMaker tab.
- Click "Enable" then click "Generate"
If you change the LoRAs or their weights:
- Uncheck "Enabled" to unload the model from memory
- Re-check "Enabled" and click "Generate" to reload the LoRAs and the pipeline into memory.
- euler
- euler ancestral
- DPM++ 2M SDE
- DPM++ 2M SDE Karras
- Will default to DDIM Scheduler for anything else
>>> Click here to download <<<
In this fork, InstantID utilizes π€ diffusers
, so it runs outside of the ksampler pipelines. I'd like to eventually add inpainting and ControlNet for π€ diffusers
but it will take some time. This requires high amounts of VRAM (easily 18GB or more). The following Fooocus configuration items are passed to the InstantID π€ diffusers
pipeline:
- Resolution (width and height)
- Prompt (and generated prompts from selected styles)
- Negative Prompt (and generated prompts from selected styles)
- Steps
- CFG/Guidance Scale
- Seed
- LoRAs
- Sampler (not fully implemented)
- Scheduler (not fully implemented)
- Navigate to the InstantID tab.
- Click "Enable"
- Load images from your PC.
- Enter your prompt and be sure to include "man img" or "woman img" depending on the subject at hand. img in the prompt is expected by PhotoMaker.
- Click "Generate"
Experiment with also adding an image to the Inswapper tab to overlay the generated image.
Note: Unchecking "Enable" will unload the InstantID pipeline from memory!
- Select the LoRAs you want to use as usual.
- Navigate to the InstantID tab.
- Click "Enable" then click "Generate"
If you change the LoRAs or their weights:
- Uncheck "Enabled" to unload the model from memory
- Re-check "Enabled" and click "Generate" to reload the LoRAs and the pipeline into memory.
- euler
- euler ancestral
- DPM++ 2M SDE
- DPM++ 2M SDE Karras
- Will default to DDIM Scheduler for anything else
Note that the minimal requirement is 4GB Nvidia GPU memory (4GB VRAM) and 8GB system memory (8GB RAM). This requires using Microsoftβs Virtual Swap technique, which is automatically enabled by your Windows installation in most cases, so you often do not need to do anything about it. However, if you are not sure, or if you manually turned it off (would anyone really do that?), or if you see any "RuntimeError: CPUAllocator", you can enable it here:
Click here to see the image instructions.
And make sure that you have at least 40GB free space on each drive if you still see "RuntimeError: CPUAllocator" !
Please open an issue if you use similar devices but still cannot achieve acceptable performances.
Note that the minimal requirement for different platforms is different.
See also the common problems and troubleshoots here.
-
open a terminal in your Fooocus folder (the one with your config.txt)
-
execute
git status
. You should see the following:On branch main Your branch is up to date with 'origin/main'. nothing to commit, working tree clean
If not, execute
git reset --hard origin/main
and checkgit status
again. -
execute
git remote set-url origin https://github.com/mashb1t/Fooocus.git git pull
-
activate your venv (not necessary when installed from 7z) and update your python packages depending on your environment (7z, venv, conda, etc.)
Example for Windows (7z):
..\python_embeded\python.exe -m pip install -r "requirements_versions.txt"
-
start Fooocus either by opening the run.bat or corresponding entrypoint (same as before)
OR
Windows: download the 7z file, extract it and run run.bat
. You may want to copy over already downloaded checkpoints / LoRAs / etc.
(Last tested - 2023 Dec 12)
Colab | Info |
---|---|
Fooocus Official |
Please report any issues in the Issues tab. I will try to help as much as I can.
- π Allow changing of insightface parameters (Inswapper)
- π Allow customizable target image (Inswapper)
- π Increase diffusers pipeline to > 77 tokens (PhotoMaker)
- π Allow dynamic loading of LoRAs into diffusers pipeline (PhotoMaker)