ci: bump actions/checkout from 4 to 5 (#4085)
Bumps actions/checkout from 4 to 5.
updated-dependencies:
- dependency-name: actions/checkout dependency-version: ‘5’ dependency-type: direct:production update-type: version-update:semver-major …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Fooocus
>>> Click Here to Install Fooocus <<<
Fooocus is an image generating software (based on Gradio
).
Fooocus presents a rethinking of image generator designs. The software is offline, open source, and free, while at the same time, similar to many online image generators like Midjourney, the manual tweaking is not needed, and users only need to focus on the prompts and images. Fooocus has also simplified the installation: between pressing “download” and generating the first image, the number of needed mouse clicks is strictly limited to less than 3. Minimal GPU memory requirement is 4GB (Nvidia).
Recently many fake websites exist on Google when you search “fooocus”. Do not trust those – here is the only official source of Fooocus.
Project Status: Limited Long-Term Support (LTS) with Bug Fixes Only
The Fooocus project, built entirely on the Stable Diffusion XL architecture, is now in a state of limited long-term support (LTS) with bug fixes only. As the existing functionalities are considered as nearly free of programmartic issues (Thanks to mashb1t‘s huge efforts), future updates will focus exclusively on addressing any bugs that may arise.
There are no current plans to migrate to or incorporate newer model architectures. However, this may change during time with the development of open-source community. For example, if the community converge to one single dominant method for image generation (which may really happen in half or one years given the current status), Fooocus may also migrate to that exact method.
For those interested in utilizing newer models such as Flux, we recommend exploring alternative platforms such as WebUI Forge (also from us), ComfyUI/SwarmUI. Additionally, several excellent forks of Fooocus are available for experimentation.
Again, recently many fake websites exist on Google when you search “fooocus”. Do NOT get Fooocus from those websites – this page is the only official source of Fooocus. We never have any website like such as “fooocus.com”, “fooocus.net”, “fooocus.co”, “fooocus.ai”, “fooocus.org”, “fooocus.pro”, “fooocus.one”. Those websites are ALL FAKE. They have ABSOLUTLY no relationship to us. Fooocus is a 100% non-commercial offline open-source software.
Features
Below is a quick list using Midjourney’s examples:
(Unknown method)
(Fooocus has an offline GPT-2 based prompt processing engine and lots of sampling improvements so that results are always beautiful, no matter if your prompt is as short as “house in garden” or as long as 1000 words)
(Fooocus uses its own inpaint algorithm and inpaint models so that results are more satisfying than all other software that uses standard SDXL inpaint method/model)
(Fooocus uses its own image prompt algorithm so that result quality and prompt understanding are more satisfying than all other software that uses standard SDXL methods like standard IP-Adapters or Revisions)
Fooocus support SDXL models on Civitai
(You can google search “Civitai” if you do not know about it)
Fooocus uses A1111’s reweighting algorithm so that results are better than ComfyUI if users directly copy prompts from Civitai. (Because if prompts are written in ComfyUI’s reweighting, users are less likely to copy prompt texts as they prefer dragging files)
To use embedding, you can use “(embedding:file_name:1.1)”
Below is a quick list using LeonardoAI’s examples:
Also, click here to browse the advanced features.
Download
Windows
You can directly download Fooocus with:
>>> Click here to download <<<
After you download the file, please uncompress it and then run the “run.bat”.
The first time you launch the software, it will automatically download models:
After Fooocus 2.1.60, you will also have
run_anime.batandrun_realistic.bat. They are different model presets (and require different models, but they will be automatically downloaded). Check here for more details.After Fooocus 2.3.0 you can also switch presets directly in the browser. Keep in mind to add these arguments if you want to change the default behavior:
--disable-preset-selectionto disable preset selection in the browser.--always-download-new-modelto download missing models on preset switch. Default is fallback toprevious_default_modelsdefined in the corresponding preset, also see terminal output.If you already have these files, you can copy them to the above locations to speed up installation.
Note that if you see “MetadataIncompleteBuffer” or “PytorchStreamReader”, then your model files are corrupted. Please download models again.
Below is a test on a relatively low-end laptop with 16GB System RAM and 6GB VRAM (Nvidia 3060 laptop). The speed on this machine is about 1.35 seconds per iteration. Pretty impressive – nowadays laptops with 3060 are usually at very acceptable price.
Besides, recently many other software report that Nvidia driver above 532 is sometimes 10x slower than Nvidia driver 531. If your generation time is very long, consider download Nvidia Driver 531 Laptop or Nvidia Driver 531 Desktop.
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.
Colab
(Last tested - 2024 Aug 12 by mashb1t)
In Colab, you can modify the last line to
!python entry_with_update.py --share --always-high-vramor!python entry_with_update.py --share --always-high-vram --preset animeor!python entry_with_update.py --share --always-high-vram --preset realisticfor Fooocus Default/Anime/Realistic Edition.You can also change the preset in the UI. Please be aware that this may lead to timeouts after 60 seconds. If this is the case, please wait until the download has finished, change the preset to initial and back to the one you’ve selected or reload the page.
Note that this Colab will disable refiner by default because Colab free’s resources are relatively limited (and some “big” features like image prompt may cause free-tier Colab to disconnect). We make sure that basic text-to-image is always working on free-tier Colab.
Using
--always-high-vramshifts resource allocation from RAM to VRAM and achieves the overall best balance between performance, flexibility and stability on the default T4 instance. Please find more information here.Thanks to camenduru for the template!
Linux (Using Anaconda)
If you want to use Anaconda/Miniconda, you can
Then download the models: download default models to the folder “Fooocus\models\checkpoints”. Or let Fooocus automatically download the models using the launcher:
Or, if you want to open a remote port, use
Use
python entry_with_update.py --preset animeorpython entry_with_update.py --preset realisticfor Fooocus Anime/Realistic Edition.Linux (Using Python Venv)
Your Linux needs to have Python 3.10 installed, and let’s say your Python can be called with the command python3 with your venv system working; you can
See the above sections for model downloads. You can launch the software with:
Or, if you want to open a remote port, use
Use
python entry_with_update.py --preset animeorpython entry_with_update.py --preset realisticfor Fooocus Anime/Realistic Edition.Linux (Using native system Python)
If you know what you are doing, and your Linux already has Python 3.10 installed, and your Python can be called with the command python3 (and Pip with pip3), you can
See the above sections for model downloads. You can launch the software with:
Or, if you want to open a remote port, use
Use
python entry_with_update.py --preset animeorpython entry_with_update.py --preset realisticfor Fooocus Anime/Realistic Edition.Linux (AMD GPUs)
Note that the minimal requirement for different platforms is different.
Same with the above instructions. You need to change torch to the AMD version
AMD is not intensively tested, however. The AMD support is in beta.
Use
python entry_with_update.py --preset animeorpython entry_with_update.py --preset realisticfor Fooocus Anime/Realistic Edition.Windows (AMD GPUs)
Note that the minimal requirement for different platforms is different.
Same with Windows. Download the software and edit the content of
run.batas:Then run the
run.bat.AMD is not intensively tested, however. The AMD support is in beta.
For AMD, use
.\python_embeded\python.exe Fooocus\entry_with_update.py --directml --preset animeor.\python_embeded\python.exe Fooocus\entry_with_update.py --directml --preset realisticfor Fooocus Anime/Realistic Edition.Mac
Note that the minimal requirement for different platforms is different.
Mac is not intensively tested. Below is an unofficial guideline for using Mac. You can discuss problems here.
You can install Fooocus on Apple Mac silicon (M1 or M2) with macOS ‘Catalina’ or a newer version. Fooocus runs on Apple silicon computers via PyTorch MPS device acceleration. Mac Silicon computers don’t come with a dedicated graphics card, resulting in significantly longer image processing times compared to computers with dedicated graphics cards.
git clone https://github.com/lllyasviel/Fooocus.git.cd Fooocus.conda env create -f environment.yaml.conda activate fooocus.pip install -r requirements_versions.txt.python entry_with_update.py. (Some Mac M2 users may needpython entry_with_update.py --disable-offload-from-vramto speed up model loading/unloading.) The first time you run Fooocus, it will automatically download the Stable Diffusion SDXL models and will take a significant amount of time, depending on your internet connection.Use
python entry_with_update.py --preset animeorpython entry_with_update.py --preset realisticfor Fooocus Anime/Realistic Edition.Docker
See docker.md
Download Previous Version
See the guidelines here.
Minimal Requirement
Below is the minimal requirement for running Fooocus locally. If your device capability is lower than this spec, you may not be able to use Fooocus locally. (Please let us know, in any case, if your device capability is lower but Fooocus still works.)
* AMD GPU ROCm (on hold): The AMD is still working on supporting ROCm on Windows.
* Nvidia GTX 1XXX 6GB uncertain: Some people report 6GB success on GTX 10XX, but some other people report failure cases.
Note that Fooocus is only for extremely high quality image generating. We will not support smaller models to reduce the requirement and sacrifice result quality.
Troubleshoot
See the common problems here.
Default Models
Given different goals, the default models and configs of Fooocus are different:
Note that the download is automatic - you do not need to do anything if the internet connection is okay. However, you can download them manually if you (or move them from somewhere else) have your own preparation.
UI Access and Authentication
In addition to running on localhost, Fooocus can also expose its UI in two ways:
--listen(specify port e.g. with--port 8888).--share(registers an endpoint at.gradio.live).In both ways the access is unauthenticated by default. You can add basic authentication by creating a file called
auth.jsonin the main directory, which contains a list of JSON objects with the keysuserandpass(see example in auth-example.json).List of “Hidden” Tricks
Click to see a list of tricks. Those are based on SDXL and are not very up-to-date with latest models.
Customization
After the first time you run Fooocus, a config file will be generated at
Fooocus\config.txt. This file can be edited to change the model path or default parameters.For example, an edited
Fooocus\config.txt(this file will be generated after the first launch) may look like this:Many other keys, formats, and examples are in
Fooocus\config_modification_tutorial.txt(this file will be generated after the first launch).Consider twice before you really change the config. If you find yourself breaking things, just delete
Fooocus\config.txt. Fooocus will go back to default.A safer way is just to try “run_anime.bat” or “run_realistic.bat” - they should already be good enough for different tasks.
Note that(Edit: it is already removed.)user_path_config.txtis deprecated and will be removed soon.All CMD Flags
Inline Prompt Features
Wildcards
Example prompt:
__color__ flowerProcessed for positive and negative prompt.
Selects a random wildcard from a predefined list of options, in this case the
wildcards/color.txtfile. The wildcard will be replaced with a random color (randomness based on seed). You can also disable randomness and process a wildcard file from top to bottom by enabling the checkboxRead wildcards in orderin Developer Debug Mode.Wildcards can be nested and combined, and multiple wildcards can be used in the same prompt (example see
wildcards/color_flower.txt).Array Processing
Example prompt:
[[red, green, blue]] flowerProcessed only for positive prompt.
Processes the array from left to right, generating a separate image for each element in the array. In this case 3 images would be generated, one for each color. Increase the image number to 3 to generate all 3 variants.
Arrays can not be nested, but multiple arrays can be used in the same prompt. Does support inline LoRAs as array elements!
Inline LoRAs
Example prompt:
flower <lora:sunflowers:1.2>Processed only for positive prompt.
Applies a LoRA to the prompt. The LoRA file must be located in the
models/lorasdirectory.Advanced Features
Click here to browse the advanced features.
Forks
Below are some Forks to Fooocus:
runew0lf/RuinedFooocus
MoonRide303/Fooocus-MRE
mashb1t/Fooocus
and so on …
Thanks
Many thanks to twri and 3Diva and Marc K3nt3L for creating additional SDXL styles available in Fooocus.
The project starts from a mixture of Stable Diffusion WebUI and ComfyUI codebases.
Also, thanks daswer123 for contributing the Canvas Zoom!
Update Log
The log is here.
Localization/Translation/I18N
You can put json files in the
languagefolder to translate the user interface.For example, below is the content of
Fooocus/language/example.json:If you add
--language examplearg, Fooocus will readFooocus/language/example.jsonto translate the UI.For example, you can edit the ending line of Windows
run.batasOr
run_anime.batasOr
run_realistic.batasFor practical translation, you may create your own file like
Fooocus/language/jp.jsonorFooocus/language/cn.jsonand then use flag--language jpor--language cn. Apparently, these files do not exist now. We need your help to create these files!Note that if no
--languageis given and at the same timeFooocus/language/default.jsonexists, Fooocus will always loadFooocus/language/default.jsonfor translation. By default, the fileFooocus/language/default.jsondoes not exist.