smraux commited on
Commit
c3e3788
1 Parent(s): 61ebe0c

Refactor code to improve performance and readability

Browse files
Files changed (1) hide show
  1. README.md +11 -427
README.md CHANGED
@@ -1,427 +1,11 @@
1
- <div align=center>
2
- <img src="https://github.com/lllyasviel/Fooocus/assets/19834515/483fb86d-c9a2-4c20-997c-46dafc124f25">
3
-
4
- **Non-cherry-picked** random batch by just typing two words "forest elf",
5
-
6
- without any parameter tweaking, without any strange prompt tags.
7
-
8
- See also **non-cherry-picked** generalization and diversity tests [here](https://github.com/lllyasviel/Fooocus/discussions/808) and [here](https://github.com/lllyasviel/Fooocus/discussions/679) and [here](https://github.com/lllyasviel/Fooocus/discussions/679#realistic).
9
-
10
- In the entire open source community, only Fooocus can achieve this level of **non-cherry-picked** quality.
11
-
12
- </div>
13
-
14
-
15
- # Fooocus
16
-
17
- Fooocus is an image generating software (based on [Gradio](https://www.gradio.app/)).
18
-
19
- Fooocus is a rethinking of Stable Diffusion and Midjourney’s designs:
20
-
21
- * Learned from Stable Diffusion, the software is offline, open source, and free.
22
-
23
- * Learned from Midjourney, the manual tweaking is not needed, and users only need to focus on the prompts and images.
24
-
25
- Fooocus has included and automated [lots of inner optimizations and quality improvements](#tech_list). Users can forget all those difficult technical parameters, and just enjoy the interaction between human and computer to "explore new mediums of thought and expanding the imaginative powers of the human species" `[1]`.
26
-
27
- Fooocus has 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).
28
-
29
- `[1]` David Holz, 2019.
30
-
31
- **Recently many fake websites exist on Google when you search “fooocus”. Do not trust those – here is the only official source of Fooocus.**
32
-
33
- ## [Installing Fooocus](#download)
34
-
35
- # Moving from Midjourney to Fooocus
36
-
37
- Using Fooocus is as easy as (probably easier than) Midjourney – but this does not mean we lack functionality. Below are the details.
38
-
39
- | Midjourney | Fooocus |
40
- | - | - |
41
- | High-quality text-to-image without needing much prompt engineering or parameter tuning. <br> (Unknown method) | High-quality text-to-image without needing much prompt engineering or parameter tuning. <br> (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) |
42
- | V1 V2 V3 V4 | Input Image -> Upscale or Variation -> Vary (Subtle) / Vary (Strong)|
43
- | U1 U2 U3 U4 | Input Image -> Upscale or Variation -> Upscale (1.5x) / Upscale (2x) |
44
- | Inpaint / Up / Down / Left / Right (Pan) | Input Image -> Inpaint or Outpaint -> Inpaint / Up / Down / Left / Right <br> (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) |
45
- | Image Prompt | Input Image -> Image Prompt <br> (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) |
46
- | --style | Advanced -> Style |
47
- | --stylize | Advanced -> Advanced -> Guidance |
48
- | --niji | [Multiple launchers: "run.bat", "run_anime.bat", and "run_realistic.bat".](https://github.com/lllyasviel/Fooocus/discussions/679) <br> Fooocus support SDXL models on Civitai <br> (You can google search “Civitai” if you do not know about it) |
49
- | --quality | Advanced -> Quality |
50
- | --repeat | Advanced -> Image Number |
51
- | Multi Prompts (::) | Just use multiple lines of prompts |
52
- | Prompt Weights | You can use " I am (happy:1.5)". <br> 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) <br> To use embedding, you can use "(embedding:file_name:1.1)" |
53
- | --no | Advanced -> Negative Prompt |
54
- | --ar | Advanced -> Aspect Ratios |
55
- | InsightFace | Input Image -> Image Prompt -> Advanced -> FaceSwap |
56
- | Describe | Input Image -> Describe |
57
-
58
- We also have a few things borrowed from the best parts of LeonardoAI:
59
-
60
- | LeonardoAI | Fooocus |
61
- | - | - |
62
- | Prompt Magic | Advanced -> Style -> Fooocus V2 |
63
- | Advanced Sampler Parameters (like Contrast/Sharpness/etc) | Advanced -> Advanced -> Sampling Sharpness / etc |
64
- | User-friendly ControlNets | Input Image -> Image Prompt -> Advanced |
65
-
66
- Fooocus also developed many "fooocus-only" features for advanced users to get perfect results. [Click here to browse the advanced features.](https://github.com/lllyasviel/Fooocus/discussions/117)
67
-
68
- # Download
69
-
70
- ### Windows
71
-
72
- You can directly download Fooocus with:
73
-
74
- **[>>> Click here to download <<<](https://github.com/lllyasviel/Fooocus/releases/download/release/Fooocus_win64_2-1-831.7z)**
75
-
76
- After you download the file, please uncompress it and then run the "run.bat".
77
-
78
- ![image](https://github.com/lllyasviel/Fooocus/assets/19834515/c49269c4-c274-4893-b368-047c401cc58c)
79
-
80
- The first time you launch the software, it will automatically download models:
81
-
82
- 1. It will download [default models](#models) to the folder "Fooocus\models\checkpoints" given different presets. You can download them in advance if you do not want automatic download.
83
- 2. Note that if you use inpaint, at the first time you inpaint an image, it will download [Fooocus's own inpaint control model from here](https://huggingface.co/lllyasviel/fooocus_inpaint/resolve/main/inpaint_v26.fooocus.patch) as the file "Fooocus\models\inpaint\inpaint_v26.fooocus.patch" (the size of this file is 1.28GB).
84
-
85
- After Fooocus 2.1.60, you will also have `run_anime.bat` and `run_realistic.bat`. They are different model presets (and require different models, but they will be automatically downloaded). [Check here for more details](https://github.com/lllyasviel/Fooocus/discussions/679).
86
-
87
- ![image](https://github.com/lllyasviel/Fooocus/assets/19834515/d386f817-4bd7-490c-ad89-c1e228c23447)
88
-
89
- If you already have these files, you can copy them to the above locations to speed up installation.
90
-
91
- Note that if you see **"MetadataIncompleteBuffer" or "PytorchStreamReader"**, then your model files are corrupted. Please download models again.
92
-
93
- 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.
94
-
95
- ![image](https://github.com/lllyasviel/Fooocus/assets/19834515/938737a5-b105-4f19-b051-81356cb7c495)
96
-
97
- 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](https://www.nvidia.com/download/driverResults.aspx/199991/en-us/) or [Nvidia Driver 531 Desktop](https://www.nvidia.com/download/driverResults.aspx/199990/en-us/).
98
-
99
- 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:
100
-
101
- <details>
102
- <summary>Click here to see the image instructions. </summary>
103
-
104
- ![image](https://github.com/lllyasviel/Fooocus/assets/19834515/2a06b130-fe9b-4504-94f1-2763be4476e9)
105
-
106
- **And make sure that you have at least 40GB free space on each drive if you still see "RuntimeError: CPUAllocator" !**
107
-
108
- </details>
109
-
110
- Please open an issue if you use similar devices but still cannot achieve acceptable performances.
111
-
112
- Note that the [minimal requirement](#minimal-requirement) for different platforms is different.
113
-
114
- See also the common problems and troubleshoots [here](troubleshoot.md).
115
-
116
- ### Colab
117
-
118
- (Last tested - 2023 Dec 12)
119
-
120
- | Colab | Info
121
- | --- | --- |
122
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lllyasviel/Fooocus/blob/main/fooocus_colab.ipynb) | Fooocus Official
123
-
124
- In Colab, you can modify the last line to `!python entry_with_update.py --share` or `!python entry_with_update.py --preset anime --share` or `!python entry_with_update.py --preset realistic --share` for Fooocus Default/Anime/Realistic Edition.
125
-
126
- 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.
127
-
128
- Thanks to [camenduru](https://github.com/camenduru)!
129
-
130
- ### Linux (Using Anaconda)
131
-
132
- If you want to use Anaconda/Miniconda, you can
133
-
134
- git clone https://github.com/lllyasviel/Fooocus.git
135
- cd Fooocus
136
- conda env create -f environment.yaml
137
- conda activate fooocus
138
- pip install -r requirements_versions.txt
139
-
140
- Then download the models: download [default models](#models) to the folder "Fooocus\models\checkpoints". **Or let Fooocus automatically download the models** using the launcher:
141
-
142
- conda activate fooocus
143
- python entry_with_update.py
144
-
145
- Or, if you want to open a remote port, use
146
-
147
- conda activate fooocus
148
- python entry_with_update.py --listen
149
-
150
- Use `python entry_with_update.py --preset anime` or `python entry_with_update.py --preset realistic` for Fooocus Anime/Realistic Edition.
151
-
152
- ### Linux (Using Python Venv)
153
-
154
- 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
155
-
156
- git clone https://github.com/lllyasviel/Fooocus.git
157
- cd Fooocus
158
- python3 -m venv fooocus_env
159
- source fooocus_env/bin/activate
160
- pip install -r requirements_versions.txt
161
-
162
- See the above sections for model downloads. You can launch the software with:
163
-
164
- source fooocus_env/bin/activate
165
- python entry_with_update.py
166
-
167
- Or, if you want to open a remote port, use
168
-
169
- source fooocus_env/bin/activate
170
- python entry_with_update.py --listen
171
-
172
- Use `python entry_with_update.py --preset anime` or `python entry_with_update.py --preset realistic` for Fooocus Anime/Realistic Edition.
173
-
174
- ### Linux (Using native system Python)
175
-
176
- 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
177
-
178
- git clone https://github.com/lllyasviel/Fooocus.git
179
- cd Fooocus
180
- pip3 install -r requirements_versions.txt
181
-
182
- See the above sections for model downloads. You can launch the software with:
183
-
184
- python3 entry_with_update.py
185
-
186
- Or, if you want to open a remote port, use
187
-
188
- python3 entry_with_update.py --listen
189
-
190
- Use `python entry_with_update.py --preset anime` or `python entry_with_update.py --preset realistic` for Fooocus Anime/Realistic Edition.
191
-
192
- ### Linux (AMD GPUs)
193
-
194
- Note that the [minimal requirement](#minimal-requirement) for different platforms is different.
195
-
196
- Same with the above instructions. You need to change torch to the AMD version
197
-
198
- pip uninstall torch torchvision torchaudio torchtext functorch xformers
199
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6
200
-
201
- AMD is not intensively tested, however. The AMD support is in beta.
202
-
203
- Use `python entry_with_update.py --preset anime` or `python entry_with_update.py --preset realistic` for Fooocus Anime/Realistic Edition.
204
-
205
- ### Windows(AMD GPUs)
206
-
207
- Note that the [minimal requirement](#minimal-requirement) for different platforms is different.
208
-
209
- Same with Windows. Download the software and edit the content of `run.bat` as:
210
-
211
- .\python_embeded\python.exe -m pip uninstall torch torchvision torchaudio torchtext functorch xformers -y
212
- .\python_embeded\python.exe -m pip install torch-directml
213
- .\python_embeded\python.exe -s Fooocus\entry_with_update.py --directml
214
- pause
215
-
216
- Then run the `run.bat`.
217
-
218
- AMD is not intensively tested, however. The AMD support is in beta.
219
-
220
- For AMD, use `.\python_embeded\python.exe entry_with_update.py --directml --preset anime` or `.\python_embeded\python.exe entry_with_update.py --directml --preset realistic` for Fooocus Anime/Realistic Edition.
221
-
222
- ### Mac
223
-
224
- Note that the [minimal requirement](#minimal-requirement) for different platforms is different.
225
-
226
- Mac is not intensively tested. Below is an unofficial guideline for using Mac. You can discuss problems [here](https://github.com/lllyasviel/Fooocus/pull/129).
227
-
228
- 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](https://pytorch.org/get-started/locally/) 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.
229
-
230
- 1. Install the conda package manager and pytorch nightly. Read the [Accelerated PyTorch training on Mac](https://developer.apple.com/metal/pytorch/) Apple Developer guide for instructions. Make sure pytorch recognizes your MPS device.
231
- 1. Open the macOS Terminal app and clone this repository with `git clone https://github.com/lllyasviel/Fooocus.git`.
232
- 1. Change to the new Fooocus directory, `cd Fooocus`.
233
- 1. Create a new conda environment, `conda env create -f environment.yaml`.
234
- 1. Activate your new conda environment, `conda activate fooocus`.
235
- 1. Install the packages required by Fooocus, `pip install -r requirements_versions.txt`.
236
- 1. Launch Fooocus by running `python entry_with_update.py`. (Some Mac M2 users may need `python entry_with_update.py --disable-offload-from-vram` to 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.
237
-
238
- Use `python entry_with_update.py --preset anime` or `python entry_with_update.py --preset realistic` for Fooocus Anime/Realistic Edition.
239
-
240
- ### Download Previous Version
241
-
242
- See the guidelines [here](https://github.com/lllyasviel/Fooocus/discussions/1405).
243
-
244
- ## Minimal Requirement
245
-
246
- 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.)
247
-
248
- | Operating System | GPU | Minimal GPU Memory | Minimal System Memory | [System Swap](troubleshoot.md) | Note |
249
- |-------------------|------------------------------|------------------------------|---------------------------|--------------------------------|----------------------------------------------------------------------------|
250
- | Windows/Linux | Nvidia RTX 4XXX | 4GB | 8GB | Required | fastest |
251
- | Windows/Linux | Nvidia RTX 3XXX | 4GB | 8GB | Required | usually faster than RTX 2XXX |
252
- | Windows/Linux | Nvidia RTX 2XXX | 4GB | 8GB | Required | usually faster than GTX 1XXX |
253
- | Windows/Linux | Nvidia GTX 1XXX | 8GB (&ast; 6GB uncertain) | 8GB | Required | only marginally faster than CPU |
254
- | Windows/Linux | Nvidia GTX 9XX | 8GB | 8GB | Required | faster or slower than CPU |
255
- | Windows/Linux | Nvidia GTX < 9XX | Not supported | / | / | / |
256
- | Windows | AMD GPU | 8GB (updated 2023 Dec 30) | 8GB | Required | via DirectML (&ast; ROCm is on hold), about 3x slower than Nvidia RTX 3XXX |
257
- | Linux | AMD GPU | 8GB | 8GB | Required | via ROCm, about 1.5x slower than Nvidia RTX 3XXX |
258
- | Mac | M1/M2 MPS | Shared | Shared | Shared | about 9x slower than Nvidia RTX 3XXX |
259
- | Windows/Linux/Mac | only use CPU | 0GB | 32GB | Required | about 17x slower than Nvidia RTX 3XXX |
260
-
261
- &ast; AMD GPU ROCm (on hold): The AMD is still working on supporting ROCm on Windows.
262
-
263
- &ast; Nvidia GTX 1XXX 6GB uncertain: Some people report 6GB success on GTX 10XX, but some other people report failure cases.
264
-
265
- *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.*
266
-
267
- ## Troubleshoot
268
-
269
- See the common problems [here](troubleshoot.md).
270
-
271
- ## Default Models
272
- <a name="models"></a>
273
-
274
- Given different goals, the default models and configs of Fooocus are different:
275
-
276
- | Task | Windows | Linux args | Main Model | Refiner | Config |
277
- | --- | --- | --- | --- | --- | --- |
278
- | General | run.bat | | [juggernautXL v6_RunDiffusion](https://huggingface.co/lllyasviel/fav_models/resolve/main/fav/juggernautXL_version6Rundiffusion.safetensors) | not used | [here](https://github.com/lllyasviel/Fooocus/blob/main/modules/path.py) |
279
- | Realistic | run_realistic.bat | --preset realistic | [realistic_stock_photo](https://huggingface.co/lllyasviel/fav_models/resolve/main/fav/realisticStockPhoto_v10.safetensors) | not used | [here](https://github.com/lllyasviel/Fooocus/blob/main/presets/realistic.json) |
280
- | Anime | run_anime.bat | --preset anime | [bluepencil_v50](https://huggingface.co/lllyasviel/fav_models/resolve/main/fav/bluePencilXL_v050.safetensors) | [dreamsharper_v8](https://huggingface.co/lllyasviel/fav_models/resolve/main/fav/DreamShaper_8_pruned.safetensors) (SD1.5) | [here](https://github.com/lllyasviel/Fooocus/blob/main/presets/anime.json) |
281
-
282
- 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.
283
-
284
- ## List of "Hidden" Tricks
285
- <a name="tech_list"></a>
286
-
287
- The below things are already inside the software, and **users do not need to do anything about these**.
288
-
289
- 1. GPT2-based [prompt expansion as a dynamic style "Fooocus V2".](https://github.com/lllyasviel/Fooocus/discussions/117#raw) (similar to Midjourney's hidden pre-processsing and "raw" mode, or the LeonardoAI's Prompt Magic).
290
- 2. Native refiner swap inside one single k-sampler. The advantage is that the refiner model can now reuse the base model's momentum (or ODE's history parameters) collected from k-sampling to achieve more coherent sampling. In Automatic1111's high-res fix and ComfyUI's node system, the base model and refiner use two independent k-samplers, which means the momentum is largely wasted, and the sampling continuity is broken. Fooocus uses its own advanced k-diffusion sampling that ensures seamless, native, and continuous swap in a refiner setup. (Update Aug 13: Actually, I discussed this with Automatic1111 several days ago, and it seems that the “native refiner swap inside one single k-sampler” is [merged]( https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12371) into the dev branch of webui. Great!)
291
- 3. Negative ADM guidance. Because the highest resolution level of XL Base does not have cross attentions, the positive and negative signals for XL's highest resolution level cannot receive enough contrasts during the CFG sampling, causing the results to look a bit plastic or overly smooth in certain cases. Fortunately, since the XL's highest resolution level is still conditioned on image aspect ratios (ADM), we can modify the adm on the positive/negative side to compensate for the lack of CFG contrast in the highest resolution level. (Update Aug 16, the IOS App [Drawing Things](https://apps.apple.com/us/app/draw-things-ai-generation/id6444050820) will support Negative ADM Guidance. Great!)
292
- 4. We implemented a carefully tuned variation of Section 5.1 of ["Improving Sample Quality of Diffusion Models Using Self-Attention Guidance"](https://arxiv.org/pdf/2210.00939.pdf). The weight is set to very low, but this is Fooocus's final guarantee to make sure that the XL will never yield an overly smooth or plastic appearance (examples [here](https://github.com/lllyasviel/Fooocus/discussions/117#sharpness)). This can almost eliminate all cases for which XL still occasionally produces overly smooth results, even with negative ADM guidance. (Update 2023 Aug 18, the Gaussian kernel of SAG is changed to an anisotropic kernel for better structure preservation and fewer artifacts.)
293
- 5. We modified the style templates a bit and added the "cinematic-default".
294
- 6. We tested the "sd_xl_offset_example-lora_1.0.safetensors" and it seems that when the lora weight is below 0.5, the results are always better than XL without lora.
295
- 7. The parameters of samplers are carefully tuned.
296
- 8. Because XL uses positional encoding for generation resolution, images generated by several fixed resolutions look a bit better than those from arbitrary resolutions (because the positional encoding is not very good at handling int numbers that are unseen during training). This suggests that the resolutions in UI may be hard coded for best results.
297
- 9. Separated prompts for two different text encoders seem unnecessary. Separated prompts for the base model and refiner may work, but the effects are random, and we refrain from implementing this.
298
- 10. The DPM family seems well-suited for XL since XL sometimes generates overly smooth texture, but the DPM family sometimes generates overly dense detail in texture. Their joint effect looks neutral and appealing to human perception.
299
- 11. A carefully designed system for balancing multiple styles as well as prompt expansion.
300
- 12. Using automatic1111's method to normalize prompt emphasizing. This significantly improves results when users directly copy prompts from civitai.
301
- 13. The joint swap system of the refiner now also supports img2img and upscale in a seamless way.
302
- 14. CFG Scale and TSNR correction (tuned for SDXL) when CFG is bigger than 10.
303
-
304
- ## Customization
305
-
306
- 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.
307
-
308
- For example, an edited `Fooocus\config.txt` (this file will be generated after the first launch) may look like this:
309
-
310
- ```json
311
- {
312
- "path_checkpoints": "D:\\Fooocus\\models\\checkpoints",
313
- "path_loras": "D:\\Fooocus\\models\\loras",
314
- "path_embeddings": "D:\\Fooocus\\models\\embeddings",
315
- "path_vae_approx": "D:\\Fooocus\\models\\vae_approx",
316
- "path_upscale_models": "D:\\Fooocus\\models\\upscale_models",
317
- "path_inpaint": "D:\\Fooocus\\models\\inpaint",
318
- "path_controlnet": "D:\\Fooocus\\models\\controlnet",
319
- "path_clip_vision": "D:\\Fooocus\\models\\clip_vision",
320
- "path_fooocus_expansion": "D:\\Fooocus\\models\\prompt_expansion\\fooocus_expansion",
321
- "path_outputs": "D:\\Fooocus\\outputs",
322
- "default_model": "realisticStockPhoto_v10.safetensors",
323
- "default_refiner": "",
324
- "default_loras": [["lora_filename_1.safetensors", 0.5], ["lora_filename_2.safetensors", 0.5]],
325
- "default_cfg_scale": 3.0,
326
- "default_sampler": "dpmpp_2m",
327
- "default_scheduler": "karras",
328
- "default_negative_prompt": "low quality",
329
- "default_positive_prompt": "",
330
- "default_styles": [
331
- "Fooocus V2",
332
- "Fooocus Photograph",
333
- "Fooocus Negative"
334
- ]
335
- }
336
- ```
337
-
338
- Many other keys, formats, and examples are in `Fooocus\config_modification_tutorial.txt` (this file will be generated after the first launch).
339
-
340
- 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.
341
-
342
- A safer way is just to try "run_anime.bat" or "run_realistic.bat" - they should already be good enough for different tasks.
343
-
344
- ~Note that `user_path_config.txt` is deprecated and will be removed soon.~ (Edit: it is already removed.)
345
-
346
- ### All CMD Flags
347
-
348
- ```
349
- entry_with_update.py [-h] [--listen [IP]] [--port PORT]
350
- [--disable-header-check [ORIGIN]]
351
- [--web-upload-size WEB_UPLOAD_SIZE]
352
- [--external-working-path PATH [PATH ...]]
353
- [--output-path OUTPUT_PATH] [--temp-path TEMP_PATH]
354
- [--cache-path CACHE_PATH] [--in-browser]
355
- [--disable-in-browser] [--gpu-device-id DEVICE_ID]
356
- [--async-cuda-allocation | --disable-async-cuda-allocation]
357
- [--disable-attention-upcast] [--all-in-fp32 | --all-in-fp16]
358
- [--unet-in-bf16 | --unet-in-fp16 | --unet-in-fp8-e4m3fn | --unet-in-fp8-e5m2]
359
- [--vae-in-fp16 | --vae-in-fp32 | --vae-in-bf16]
360
- [--clip-in-fp8-e4m3fn | --clip-in-fp8-e5m2 | --clip-in-fp16 | --clip-in-fp32]
361
- [--directml [DIRECTML_DEVICE]] [--disable-ipex-hijack]
362
- [--preview-option [none,auto,fast,taesd]]
363
- [--attention-split | --attention-quad | --attention-pytorch]
364
- [--disable-xformers]
365
- [--always-gpu | --always-high-vram | --always-normal-vram |
366
- --always-low-vram | --always-no-vram | --always-cpu]
367
- [--always-offload-from-vram] [--disable-server-log]
368
- [--debug-mode] [--is-windows-embedded-python]
369
- [--disable-server-info] [--share] [--preset PRESET]
370
- [--language LANGUAGE] [--disable-offload-from-vram]
371
- [--theme THEME] [--disable-image-log]
372
- ```
373
-
374
- ## Advanced Features
375
-
376
- [Click here to browse the advanced features.](https://github.com/lllyasviel/Fooocus/discussions/117)
377
-
378
- Fooocus also has many community forks, just like SD-WebUI's [vladmandic/automatic](https://github.com/vladmandic/automatic) and [anapnoe/stable-diffusion-webui-ux](https://github.com/anapnoe/stable-diffusion-webui-ux), for enthusiastic users who want to try!
379
-
380
- | Fooocus' forks |
381
- | - |
382
- | [fenneishi/Fooocus-Control](https://github.com/fenneishi/Fooocus-Control) </br>[runew0lf/RuinedFooocus](https://github.com/runew0lf/RuinedFooocus) </br> [MoonRide303/Fooocus-MRE](https://github.com/MoonRide303/Fooocus-MRE) </br> [metercai/SimpleSDXL](https://github.com/metercai/SimpleSDXL) </br> and so on ... |
383
-
384
- See also [About Forking and Promotion of Forks](https://github.com/lllyasviel/Fooocus/discussions/699).
385
-
386
- ## Thanks
387
-
388
- Special thanks to [twri](https://github.com/twri) and [3Diva](https://github.com/3Diva) and [Marc K3nt3L](https://github.com/K3nt3L) for creating additional SDXL styles available in Fooocus. Thanks [daswer123](https://github.com/daswer123) for contributing the Canvas Zoom!
389
-
390
- ## Update Log
391
-
392
- The log is [here](update_log.md).
393
-
394
- ## Localization/Translation/I18N
395
-
396
- **We need your help!** Please help translate Fooocus into international languages.
397
-
398
- You can put json files in the `language` folder to translate the user interface.
399
-
400
- For example, below is the content of `Fooocus/language/example.json`:
401
-
402
- ```json
403
- {
404
- "Generate": "生成",
405
- "Input Image": "入力画像",
406
- "Advanced": "고급",
407
- "SAI 3D Model": "SAI 3D Modèle"
408
- }
409
- ```
410
-
411
- If you add `--language example` arg, Fooocus will read `Fooocus/language/example.json` to translate the UI.
412
-
413
- For example, you can edit the ending line of Windows `run.bat` as
414
-
415
- .\python_embeded\python.exe -s Fooocus\entry_with_update.py --language example
416
-
417
- Or `run_anime.bat` as
418
-
419
- .\python_embeded\python.exe -s Fooocus\entry_with_update.py --language example --preset anime
420
-
421
- Or `run_realistic.bat` as
422
-
423
- .\python_embeded\python.exe -s Fooocus\entry_with_update.py --language example --preset realistic
424
-
425
- For practical translation, you may create your own file like `Fooocus/language/jp.json` or `Fooocus/language/cn.json` and then use flag `--language jp` or `--language cn`. Apparently, these files do not exist now. **We need your help to create these files!**
426
-
427
- Note that if no `--language` is given and at the same time `Fooocus/language/default.json` exists, Fooocus will always load `Fooocus/language/default.json` for translation. By default, the file `Fooocus/language/default.json` does not exist.
 
1
+ ---
2
+ title: Img Gen With Fooocus Space
3
+ emoji: 👁
4
+ colorFrom: pink
5
+ colorTo: pink
6
+ sdk: docker
7
+ pinned: false
8
+ license: mit
9
+ ---
10
+
11
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference