Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mrhan1993/Fooocus-API
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.4.0.2
Choose a base ref
...
head repository: mrhan1993/Fooocus-API
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 50,580 additions and 2,365 deletions.
  1. +21 −38 .gitignore
  2. +1 −1 Dockerfile
  3. +61 −22 README.md
  4. +72 −30 README_zh.md
  5. +1 −1 cog.yaml
  6. +12 −1 docs/api_doc_en.md
  7. +33 −20 docs/api_doc_zh.md
  8. BIN docs/assets/tasks.png
  9. +178 −0 docs/change_logs.md
  10. +178 −0 docs/change_logs_zh.md
  11. +377 −0 docs/migrate.md
  12. +377 −0 docs/migrate_zh.md
  13. +4,018 −1 docs/openapi.json
  14. +6 −15 examples/examples.ipynb
  15. +36 −2 examples/examples_v1.py
  16. +56 −0 examples/examples_v2.py
  17. +21 −0 extras/BLIP/configs/bert_config.json
  18. +33 −0 extras/BLIP/configs/caption_coco.yaml
  19. +21 −0 extras/BLIP/configs/med_config.json
  20. +21 −0 extras/BLIP/configs/nlvr.yaml
  21. +15 −0 extras/BLIP/configs/nocaps.yaml
  22. +27 −0 extras/BLIP/configs/pretrain.yaml
  23. +34 −0 extras/BLIP/configs/retrieval_coco.yaml
  24. +34 −0 extras/BLIP/configs/retrieval_flickr.yaml
  25. +12 −0 extras/BLIP/configs/retrieval_msrvtt.yaml
  26. +25 −0 extras/BLIP/configs/vqa.yaml
  27. +23 −0 extras/BLIP/models/bert_tokenizer/config.json
  28. +1 −0 extras/BLIP/models/bert_tokenizer/tokenizer.json
  29. +3 −0 extras/BLIP/models/bert_tokenizer/tokenizer_config.json
  30. +30,522 −0 extras/BLIP/models/bert_tokenizer/vocab.txt
  31. +239 −0 extras/BLIP/models/blip.py
  32. +76 −0 extras/BLIP/models/blip_itm.py
  33. +105 −0 extras/BLIP/models/blip_nlvr.py
  34. +339 −0 extras/BLIP/models/blip_pretrain.py
  35. +319 −0 extras/BLIP/models/blip_retrieval.py
  36. +186 −0 extras/BLIP/models/blip_vqa.py
  37. +955 −0 extras/BLIP/models/med.py
  38. +843 −0 extras/BLIP/models/nlvr_encoder.py
  39. +308 −0 extras/BLIP/models/vit.py
  40. +43 −0 extras/GroundingDINO/config/GroundingDINO_SwinT_OGC.py
  41. +100 −0 extras/GroundingDINO/util/inference.py
  42. +60 −0 extras/censor.py
  43. +129 −0 extras/expansion.py
  44. +50 −0 extras/face_crop.py
  45. +31 −0 extras/facexlib/detection/__init__.py
  46. +219 −0 extras/facexlib/detection/align_trans.py
  47. +317 −0 extras/facexlib/detection/matlab_cp2tform.py
  48. +366 −0 extras/facexlib/detection/retinaface.py
  49. +196 −0 extras/facexlib/detection/retinaface_net.py
  50. +421 −0 extras/facexlib/detection/retinaface_utils.py
  51. +24 −0 extras/facexlib/parsing/__init__.py
  52. +140 −0 extras/facexlib/parsing/bisenet.py
  53. +194 −0 extras/facexlib/parsing/parsenet.py
  54. +69 −0 extras/facexlib/parsing/resnet.py
  55. +7 −0 extras/facexlib/utils/__init__.py
  56. +374 −0 extras/facexlib/utils/face_restoration_helper.py
  57. +250 −0 extras/facexlib/utils/face_utils.py
  58. +118 −0 extras/facexlib/utils/misc.py
  59. +130 −0 extras/inpaint_mask.py
  60. +63 −0 extras/interrogate.py
  61. +284 −0 extras/ip_adapter.py
  62. +81 −0 extras/preprocessors.py
  63. +120 −0 extras/resampler.py
  64. +171 −0 extras/safety_checker/configs/config.json
  65. +20 −0 extras/safety_checker/configs/preprocessor_config.json
  66. +126 −0 extras/safety_checker/models/safety_checker.py
  67. +288 −0 extras/sam/predictor.py
  68. +109 −0 extras/vae_interpose.py
  69. +98 −0 extras/wd14tagger.py
  70. +1 −1 fooocus_api_version.py
  71. +45 −3 fooocusapi/api.py
  72. +92 −0 fooocusapi/configs/default.py
  73. +75 −9 fooocusapi/models/common/base.py
  74. +118 −0 fooocusapi/models/common/image_meta.py
  75. +29 −9 fooocusapi/models/common/requests.py
  76. +3 −0 fooocusapi/models/common/response.py
  77. +1 −0 fooocusapi/models/common/task.py
  78. +342 −136 fooocusapi/models/requests_v1.py
  79. +16 −3 fooocusapi/models/requests_v2.py
  80. +41 −137 fooocusapi/parameters.py
  81. +31 −2 fooocusapi/routes/generate_v1.py
  82. +51 −3 fooocusapi/routes/generate_v2.py
  83. +38 −6 fooocusapi/routes/query.py
  84. +78 −8 fooocusapi/sql_client.py
  85. +7 −3 fooocusapi/task_queue.py
  86. +94 −33 fooocusapi/utils/api_utils.py
  87. +34 −2 fooocusapi/utils/call_worker.py
  88. +20 −26 fooocusapi/utils/file_utils.py
  89. +47 −8 fooocusapi/utils/img_utils.py
  90. +12 −1 fooocusapi/utils/logger.py
  91. +27 −15 fooocusapi/utils/lora_manager.py
  92. +1,409 −759 fooocusapi/worker.py
  93. +28 −19 main.py
  94. +6 −3 predict.py
  95. +11 −5 repositories/Fooocus/args_manager.py
  96. +2 −2 repositories/Fooocus/extras/BLIP/models/blip.py
  97. +2 −2 repositories/Fooocus/extras/BLIP/models/blip_nlvr.py
  98. +43 −0 repositories/Fooocus/extras/GroundingDINO/config/GroundingDINO_SwinT_OGC.py
  99. +100 −0 repositories/Fooocus/extras/GroundingDINO/util/inference.py
  100. +60 −0 repositories/Fooocus/extras/censor.py
  101. +1 −1 repositories/Fooocus/extras/facexlib/detection/__init__.py
  102. +1 −1 repositories/Fooocus/extras/facexlib/parsing/__init__.py
  103. +130 −0 repositories/Fooocus/extras/inpaint_mask.py
  104. +1 −1 repositories/Fooocus/extras/ip_adapter.py
  105. +171 −0 repositories/Fooocus/extras/safety_checker/configs/config.json
  106. +20 −0 repositories/Fooocus/extras/safety_checker/configs/preprocessor_config.json
  107. +126 −0 repositories/Fooocus/extras/safety_checker/models/safety_checker.py
  108. +288 −0 repositories/Fooocus/extras/sam/predictor.py
  109. +54 −38 repositories/Fooocus/extras/vae_interpose.py
  110. +1 −1 repositories/Fooocus/fooocus_version.py
  111. +55 −0 repositories/Fooocus/ldm_patched/contrib/external_align_your_steps.py
  112. +21 −2 repositories/Fooocus/ldm_patched/contrib/external_custom_sampler.py
  113. +14 −3 repositories/Fooocus/ldm_patched/contrib/external_model_advanced.py
  114. +99 −1 repositories/Fooocus/ldm_patched/k_diffusion/sampling.py
  115. +1 −1 repositories/Fooocus/ldm_patched/ldm/modules/encoders/noise_aug_modules.py
  116. +1 −0 repositories/Fooocus/ldm_patched/modules/args_parser.py
  117. +65 −0 repositories/Fooocus/ldm_patched/modules/latent_formats.py
  118. +82 −9 repositories/Fooocus/ldm_patched/modules/model_sampling.py
  119. +1 −1 repositories/Fooocus/ldm_patched/modules/samplers.py
  120. +9 −4 repositories/Fooocus/ldm_patched/modules/sd.py
  121. +1 −1 repositories/Fooocus/ldm_patched/modules/sd1_clip.py
  122. +3 −3 repositories/Fooocus/ldm_patched/pfn/architecture/face/codeformer.py
  123. +2 −2 repositories/Fooocus/ldm_patched/pfn/architecture/face/gfpgan_bilinear_arch.py
  124. +2 −2 repositories/Fooocus/ldm_patched/pfn/architecture/face/gfpganv1_arch.py
  125. +2 −2 repositories/Fooocus/ldm_patched/pfn/architecture/face/gfpganv1_clean_arch.py
  126. 0 repositories/Fooocus/models/safety_checker/put_safety_checker_models_here
  127. 0 repositories/Fooocus/modules/__init__.py
  128. +1,245 −689 repositories/Fooocus/modules/async_worker.py
  129. +371 −67 repositories/Fooocus/modules/config.py
  130. +9 −7 repositories/Fooocus/modules/core.py
  131. +25 −8 repositories/Fooocus/modules/default_pipeline.py
  132. +41 −0 repositories/Fooocus/modules/extra_utils.py
  133. +64 −12 repositories/Fooocus/modules/flags.py
  134. +83 −0 repositories/Fooocus/modules/hash_cache.py
  135. +1 −1 repositories/Fooocus/modules/inpaint_worker.py
  136. +153 −74 repositories/Fooocus/modules/meta_parser.py
  137. +2 −0 repositories/Fooocus/modules/model_loader.py
  138. +2 −0 repositories/Fooocus/modules/patch_precision.py
  139. +10 −4 repositories/Fooocus/modules/private_logger.py
  140. +5 −1 repositories/Fooocus/modules/sample_hijack.py
  141. +14 −38 repositories/Fooocus/modules/sdxl_styles.py
  142. +1 −1 repositories/Fooocus/modules/ui_gradio_extensions.py
  143. +7 −8 repositories/Fooocus/modules/upscaler.py
  144. +179 −30 repositories/Fooocus/modules/util.py
  145. +2 −0 repositories/Fooocus/presets/.gitignore
  146. +14 −5 repositories/Fooocus/presets/anime.json
  147. +1 −0 repositories/Fooocus/presets/default.json
  148. +1 −0 repositories/Fooocus/presets/lcm.json
  149. +51 −0 repositories/Fooocus/presets/playground_v2.5.json
  150. +54 −0 repositories/Fooocus/presets/pony_v6.json
  151. +3 −2 repositories/Fooocus/presets/realistic.json
  152. +1 −0 repositories/Fooocus/presets/sai.json
  153. BIN repositories/Fooocus/sdxl_styles/samples/fooocus_pony.jpg
  154. BIN repositories/Fooocus/sdxl_styles/samples/random_style.jpg
  155. +6 −1 repositories/Fooocus/sdxl_styles/sdxl_styles_fooocus.json
  156. +8 −0 repositories/Fooocus/wildcards/.gitignore
  157. +26 −18 requirements.txt
59 changes: 21 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#ide config
.idea
.vscode

#runtime
__pycache__
.DS_Store

# models
*.ckpt
*.safetensors
@@ -22,46 +28,23 @@ conda
logs
log

sorted_styles.json
/language/default.json
lena.png
lena_result.png
lena_test.py
# config files
.cog
config.txt
config_modification_tutorial.txt
user_path_config.txt
user_path_config-deprecated.txt
build_chb.py
experiment.py
/modules/*.png
/tmp
/ui-config.json
/outputs
/config.json
/webui.settings.bat
/embeddings
/styles.csv
/params.txt
/styles.csv.bak
/webui-user.bat
/webui-user.sh
/interrogate
/user.css
/.idea
/notification.ogg
/notification.mp3
/SwinIR
/textual_inversion
.vscode
/extensions
/test/stdout.txt
/test/stderr.txt
/cache.json*
/config_states/
/node_modules
/package-lock.json
/.coverage*
/auth.json
.cog/
hash_cache.txt

sorted_styles.json
/presets
*.db

# db
*.db

# cache
outputs

#other
*.http
hash_cache.txt
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ COPY . /app

RUN pip install --no-cache-dir -r requirements.txt

RUN pip install --no-cache-dir opencv-python-headless
RUN pip install --no-cache-dir opencv-python-headless -i https://pypi.org/simple

EXPOSE 8888

83 changes: 61 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -19,10 +19,67 @@
- [License](#license)
- [Thanks :purple\_heart:](#thanks-purple_heart)

# :warning: Compatibility warning :warning:
> Note:
>
> Although I tested it, I still suggest you test it again before the official update
>
> Fooocus 2.5 includes a significant update, with most dependencies upgraded. Therefore, after updating, do not use `--skip-pip` unless you have already performed a manual update.
>
> Additionally, `groundingdino-py` may encounter installation errors, especially in Chinese Windows environments. The solution can be found in the following [issue](https://github.com/IDEA-Research/GroundingDINO/issues/206).

> GenerateMask is same as DescribeImage, It is not process as a task, result will directly return
# Instructions for Using the ImageEnhance Interface
Below are examples of parameters that include the main parameters required for ImageEnhance. The V1 interface adopts a form-like approach similar to ImagePrompt to break down the enhance controller.


```python
{
"enhance_input_image": "",
"enhance_checkbox": true,
"enhance_uov_method": "Vary (Strong)",
"enhance_uov_processing_order": "Before First Enhancement",
"enhance_uov_prompt_type": "Original Prompts",
"save_final_enhanced_image_only": true,
"enhance_ctrlnets": [
{
"enhance_enabled": false,
"enhance_mask_dino_prompt": "face",
"enhance_prompt": "",
"enhance_negative_prompt": "",
"enhance_mask_model": "sam",
"enhance_mask_cloth_category": "full",
"enhance_mask_sam_model": "vit_b",
"enhance_mask_text_threshold": 0.25,
"enhance_mask_box_threshold": 0.3,
"enhance_mask_sam_max_detections": 0,
"enhance_inpaint_disable_initial_latent": false,
"enhance_inpaint_engine": "v2.6",
"enhance_inpaint_strength": 1,
"enhance_inpaint_respective_field": 0.618,
"enhance_inpaint_erode_or_dilate": 0,
"enhance_mask_invert": false
}
]
}
```

- enhance_input_image: The image to be enhanced, which is required and can be provided as an image URL for the V2 interface.
- enhance_checkbox: A toggle switch that must be set to true if you want to use the enhance image feature.
- save_final_enhanced_image_only: Since image enhancement is a pipeline operation, it can produce multiple result images. This parameter allows you to only return the final enhanced image.

There are three parameters related to UpscaleVary, which are used to perform Upscale or Vary before or after enhancement.

- enhance_uov_method: Similar to the UpscaleOrVary interface, Disabled turns it off.
- enhance_uov_processing_order: Determines whether to process the image before or after enhancement.
- enhance_uov_prompt_type: I'm not sure about the specific function; you might want to research it based on the WebUI.

The `enhance_ctrlnets` element is a list of ImageEnhance controller objects, with a maximum of three elements in the list, any additional elements will be discarded. The parameters correspond roughly to the WebUI, and the notable parameters are:

- enhance_enabled: This parameter controls whether the enhance controller is active. If there are no enabled enhance controllers, the task will be skipped.
- enhance_mask_dino_prompt: This parameter is required and indicates the area to be enhanced. If it is empty, even if the enhance controller is enabled, the task will be skipped.

1. If you are using an external Fooocus model (that is, the model is not located in the `repositories` directory), delete the `repositories` directory directly, and then update the `git pull`.
2. If not, move the `repositories` directory to any directory, delete the `repositories` directory, then update the `git pull`, and move the `models` directory back to its original location when it is finished.

# Introduction

@@ -207,25 +264,7 @@ For Fooocus CMD flags, see [here](https://github.com/lllyasviel/Fooocus?tab=read
# Change log
**[24/01/31] v0.3.30** : Add secure API future, use `--apikey APIKEY` to set apikey at startup
**[24/01/26] v0.3.30** : Optimize the underlying logic of task execution, default queue size to 100
**[24/01/10] v0.3.29** : support for store history to db
**[24/01/09] v0.3.29** : Image Prompt Mixing requirements implemented, With this implementation, you can send image prompts, and perform inpainting or upscale with a single request.
**[24/01/04] v0.3.29** : Merged Fooocus v2.1.860
**[24/01/03] v0.3.28** : add text-to-image-with-ip interface
**[23/12/29] v0.3.27** : Add describe interface,now you can get prompt from image
**[23/12/29] v0.3.27** : Add query job history api. Add webhook_url support for each generation request.
**[23/12/28] v0.3.26** : **Break Change**: Add web-hook cmd flag for notify generation result. Change async job id to uuid to avoid conflict between each startup.
**[23/12/22] v0.3.25** : Add CMD flags support of Fooocus. **Break Change**: Removed cli argument `disable-private-log`. You can use Fooocus's `--disable-image-log` for the same purpose.
[CHANGELOG](./docs/change_logs.md)
older change history you can find in [release page](https://github.com/konieshadow/Fooocus-API/releases)
102 changes: 72 additions & 30 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -19,20 +19,76 @@
- [License](#license)
- [感谢 :purple\_heart:](#感谢-purple_heart)

# :warning: 兼容性警告 :warning:

1. 如果你使用的是外部 Fooocus 模型(即模型不是位于 `repositories/Fooocus/models` 目录下),直接删除 `repositories` 目录,然后执行 `git pull` 更新即可
2. 如果不是上述方式,将 `repositories/Fooocus/models` 目录移动到任意目录,删除 `repositories` 目录,然后执行 `git pull` 更新,完成后将 `models` 目录移动回原位置
> 注意:
>
> 尽管我进行了测试,但我仍建议你在正式更新前再测一遍
>
> Fooocus 2.5 包含大量更新,其中多数依赖进行了升级,因此,更新后请不要使用 `--skip-pip`. 除非你已经进行过手动更新
>
> 此外, `groundingdino-py` 可能会遇到安装错误, 特别是在中文 windows 环境中, 解决办法参考: [issues](https://github.com/IDEA-Research/GroundingDINO/issues/206)
> 和 DescribeImage 一样,GenerateMask 不会作为 task 处理而是直接返回结果
# ImageEnhance 接口的使用说明

以下面的参数为例,它包含了 ImageEnhance 所需要的主要参数,V1 接口采用和 ImagePrompt 类似的方式将 enhance 控制器拆分成表单形式:

```python
{
"enhance_input_image": "",
"enhance_checkbox": true,
"enhance_uov_method": "Vary (Strong)",
"enhance_uov_processing_order": "Before First Enhancement",
"enhance_uov_prompt_type": "Original Prompts",
"save_final_enhanced_image_only": true,
"enhance_ctrlnets": [
{
"enhance_enabled": false,
"enhance_mask_dino_prompt": "face",
"enhance_prompt": "",
"enhance_negative_prompt": "",
"enhance_mask_model": "sam",
"enhance_mask_cloth_category": "full",
"enhance_mask_sam_model": "vit_b",
"enhance_mask_text_threshold": 0.25,
"enhance_mask_box_threshold": 0.3,
"enhance_mask_sam_max_detections": 0,
"enhance_inpaint_disable_initial_latent": false,
"enhance_inpaint_engine": "v2.6",
"enhance_inpaint_strength": 1,
"enhance_inpaint_respective_field": 0.618,
"enhance_inpaint_erode_or_dilate": 0,
"enhance_mask_invert": false
}
]
}
```

- enhance_input_image:需要增强的图像,如果是 v2 接口,可以提供一个图像 url,必选
- enhance_checkbox:总开关,使用 enhance image 必须设置为 true
- save_final_enhanced_image_only:图像增强是一个管道作业,因此会产生多个结果图像,使用该参数仅返回最终图像

有三个和 UpscaleVary 相关的参数,其作用是执行增强之前或完成增强之后执行 Upscale 或 Vary

- enhance_uov_method:和 UpscaleOrVary 接口一样,Disabled 是关闭
- enhance_uov_processing_order:在增强之前处理还是处理增强后的图像
- enhance_uov_prompt_type:我也不知道具体作用,对着 WebUI 研究研究🧐

`enhance_ctrlnets` 元素为 ImageEnhance 控制器对象列表,该列表最多包含 3 个元素,多余会被丢弃。参数和 WebUI 基本一一对应,需要注意的参数是:

- enhance_enabled:参数控制该 enhance 控制器是否工作,如果没有开启的 enhance 控制器,任务会被跳过
- enhance_mask_dino_prompt:该参数必选,表示需要增强的部位,如果该参数为空,即便 enhance 控制器处于开启状态,也会跳过

# 简介

使用 FastAPI 构建的 [Fooocus](https://github.com/lllyasviel/Fooocus) 的 API。

当前支持的 Fooocus 版本: [2.3.0](https://github.com/lllyasviel/Fooocus/blob/main/update_log.md)
当前支持的 Fooocus 版本: [2.5.3](https://github.com/lllyasviel/Fooocus/blob/main/update_log.md)

## Fooocus

该部分出自 [Fooocus](https://github.com/lllyasviel/Fooocus) 项目。
**该章节来自 [Fooocus](https://github.com/lllyasviel/Fooocus) 项目。**

Fooocus 是一个图像生成软件 (基于 [Gradio](https://www.gradio.app/))。

@@ -46,11 +102,11 @@ Fooocus 包含了许多内部优化以及质量改进。 忘记那些复杂困

## Fooocus-API

可能你已经尝试过使用 [Gradio client](https://www.gradio.app/docs/client) 来调用 Fooocus,对我来说可真是不咋地
可能您已经尝试过通过 [Gradio 客户端](https://www.gradio.app/docs/client) 来接入 Fooocus,但您可能发现体验并不理想。

Fooocus API 使用 [FastAPI](https://fastapi.tiangolo.com/) 构建了一系列 `REST` API 来使用 Fooocus。现在,你可以用任何你喜欢的编程语言来调用 Fooocus 的强大能力
Fooocus API 是基于 [FastAPI](https://fastapi.tiangolo.com/) 构建的一系列 `REST` 接口,它们使得利用 Fooocus 的强大功能变得简单易行。现在,您可以使用任何您喜欢的编程语言来轻松地与 Fooocus 进行交互

此外,我们还提供了详细的 [文档](/docs/api_doc_zh.md) [示例代码](/examples)
此外,我们还提供了详尽的 [API 文档](/docs/api_doc_zh.md) 和丰富的 [示例代码](/examples),以帮助您快速上手和深入了解如何有效地利用 Fooocus。

# 开始

@@ -63,7 +119,9 @@ Fooocus API 使用 [FastAPI](https://fastapi.tiangolo.com/) 构建了一系列
- [konieshadow/fooocus-api-anime](https://replicate.com/konieshadow/fooocus-api-anime)
- [konieshadow/fooocus-api-realistic](https://replicate.com/konieshadow/fooocus-api-realistic)

我认为这是更简单的体验 Fooocus's 强大的方法
我认为这是更简单的方法来体验 Fooocus 的强大

> 出于某些原因,上述 replicate 上的实例版本无法更新,你可以参照 [push-a-model](https://replicate.com/docs/guides/push-a-model) 部署自己专用的实例。
## 自托管

@@ -109,11 +167,13 @@ source venv/bin/activate

首先,安装 requirements: `pip install -r requirements.txt`

然后安装 pytorch+cuda: `pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121` 更多安装信息在[这儿](https://pytorch.org/get-started/previous-versions/),
然后安装 pytorch+cuda: `pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121`

更多安装信息在 pytorch 官方的 [previous-versions](https://pytorch.org/get-started/previous-versions/) 页面找到。

> 关于 pytorch 和 cuda 的版本,Fooocus API 使用的是 Fooocus 推荐的版本,目前是 pytorch2.1.0+cuda12.1。如果你是个 "犟种" 非要用其他版本,我测试过也是可以的,不过启动的时候记得加上 `--skip-pip`,否则程序会自动替换为推荐版本。
进入 `repositories` 的目录,下载的模型放到这个目录 `repositories\Fooocus\models`。如果你有一个已经安装完成的 Fooocus,查看[这里](#已经有安装好的-fooocus)
进入 `repositories` 的目录,下载的模型放到这个目录 `repositories\Fooocus\models`。如果你有一个已经安装完成的 Fooocus,[这里](#已经有安装好的-fooocus)查看如何复用模型

这里是一个启动必须下载的模型列表 (也可能不一样如果 [启动参数](#命令行参数) 不同的话):

@@ -205,25 +265,7 @@ python main.py --all-in-fp16 --always-gpu
# 更新日志
**[24/01/31] v0.3.30** : 增加接口认证功能, 可以通过启动参数 `--apikey APIKEY` 来设置 apikey
**[24/01/26] v0.3.30** : 优化任务执行底层逻辑。调整默认队列大小为100
**[24/01/10] v0.3.29** : 支持将历史生成数据持久化到数据库,并且支持从数据库中读取历史数据
**[24/01/09] v0.3.29** : Image Prompt Mixing requirements implemented, With this implementation, you can send image prompts, and perform inpainting or upscale with a single request.
**[24/01/04] v0.3.29** : 合并了 Fooocus v2.1.860
**[24/01/03] v0.3.28** : 增加 text-to-image-with-ip 接口
**[23/12/29] v0.3.27** : 增加 describe 接口,现在你可以使用图像反推提示词了
**[23/12/29] v0.3.27** : 增加查询历史 API。增加 webhook_url 对所有请求的支持
**[23/12/28] v0.3.26** : **重大变更**: 添加 webhook 选项以支持生成完毕后的事件通知。将 async 的任务 ID 由数字改为 UUID 来避免应用重启后造成的混乱
**[23/12/22] v0.3.25** : 增加对 Fooocus 命令行选项的支持 **重大变更**: 移除 `disable-private-log` 选项,你可以使用 Fooocus 原生的 `--disable-image-log` 来达到同样的效果
[CHANGELOG](./docs/change_logs_zh.md)
更早的日志可以在 [release page](https://github.com/konieshadow/Fooocus-API/releases) 找到
2 changes: 1 addition & 1 deletion cog.yaml
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ build:
- "colorlog==6.8.2"
- "rich==13.7.1"

# commands run after the environment is setup
# commands run after the environment is set up
# run:
# - "echo env is ready!"
# - "echo another command if needed"
13 changes: 12 additions & 1 deletion docs/api_doc_en.md
Original file line number Diff line number Diff line change
@@ -61,6 +61,11 @@ DataType: json
| loras | List[Lora] | lora list, include conf, lora: [Lora](#lora) |
| advanced_params | AdvancedParams | Advanced params, [AdvancedParams](#advanceparams) |
| require_base64 | bool | require base64, default to False |
| save_meta | bool | save metadata to image, default True |
| meta_scheme | str | metadata scheme, default 'fooocus', only support 'fooocus' now |
| save_extension | str | extension for saved image, default 'png' |
| save_name | str | image name saved, default job_id + seq |
| read_wildcards_in_order | bool | read wildcards in order, default False |
| async_process | bool | is async, default to False |
| webhook_url | str | after async task completed, address for callback, default to None, refer to [webhook](#webhook) |

@@ -665,6 +670,8 @@ EndPoint: /v1/engines/refresh-models
Method: Post
```

> Removed, use [all-models](#all-models) instead

**requests example**
```python
def refresh() -> dict:
@@ -933,14 +940,18 @@ Submit a task in any way, and after completion, you will see the task completion
| freeu_s2 | float | FreeU B4, default to 0.95 |
| debugging_inpaint_preprocessor | bool | Debug Inpaint Preprocessing, default to False |
| inpaint_disable_initial_latent | bool | Disable initial latent in inpaint, default to False |
| inpaint_engine | str | Inpaint Engine, default to `v1` |
| inpaint_engine | str | Inpaint Engine, default to `v2.6` |
| inpaint_strength | float | Inpaint Denoising Strength, default to 1.0, range 0.0-1.0 |
| inpaint_respective_field | float | Inpaint Respective Field, default to 1.0, range 0.0-1.0 |
| inpaint_mask_upload_checkbox | bool | upload mask, default False |
| invert_mask_checkbox | bool | revert mask, default False |
| inpaint_erode_or_dilate | int | Mask Erode or Dilate, default 0, -64-64 |

## lora

| Name | Type | Description |
|------------|-------|------------------------|
| enabled | bool | enable lora |
| model_name | str | model name |
| weight | float | weight, default to 0.5 |

Loading