[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-mrhan1993--Fooocus-API":3,"tool-mrhan1993--Fooocus-API":62},[4,18,26,35,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,2,"2026-04-18T11:18:24",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":32,"last_commit_at":41,"category_tags":42,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[43,13,15,14],"插件",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[52,15,13,14],"语言模型",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,61],"视频",{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":68,"readme_en":69,"readme_zh":70,"quickstart_zh":71,"use_case_zh":72,"hero_image_url":73,"owner_login":74,"owner_name":75,"owner_avatar_url":76,"owner_bio":75,"owner_company":77,"owner_location":78,"owner_email":79,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":94,"difficulty_score":10,"env_os":95,"env_gpu":96,"env_ram":97,"env_deps":98,"category_tags":108,"github_topics":109,"view_count":32,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":114,"updated_at":115,"faqs":116,"releases":117},9364,"mrhan1993\u002FFooocus-API","Fooocus-API","FastAPI powered API for Fooocus","Fooocus-API 是为知名 AI 绘图工具 Fooocus 打造的 FastAPI 接口服务，旨在将原本主要面向图形界面操作的功能转化为可编程调用的 API。它解决了开发者难以将 Fooocus 强大的图像生成与增强能力集成到自有应用、自动化工作流或后端服务中的痛点，让复杂的绘图逻辑可以通过简单的 HTTP 请求轻松触发。\n\n这款工具特别适合后端开发者、AI 应用构建者以及希望实现批量图像处理的研究人员使用。对于熟悉 Python 或需要搭建自定义绘图服务的团队，它提供了极大的灵活性；而普通用户若希望通过脚本自动执行任务，也能从中受益。\n\n其技术亮点在于完整保留了 Fooocus 的核心特性，包括基于描述的重绘（DescribeImage）、智能图像增强（ImageEnhance）以及多阶段控制网络（ControlNets）支持。特别是在图像增强方面，Fooocus-API 允许通过参数精细控制放大、变异（Upscale\u002FVary）的顺序与强度，并支持结合 GroundingDINO 和 SAM 模型进行基于文本提示的局部遮罩修复。此外，项目提供了 Docker 镜像及多种本地部","Fooocus-API 是为知名 AI 绘图工具 Fooocus 打造的 FastAPI 接口服务，旨在将原本主要面向图形界面操作的功能转化为可编程调用的 API。它解决了开发者难以将 Fooocus 强大的图像生成与增强能力集成到自有应用、自动化工作流或后端服务中的痛点，让复杂的绘图逻辑可以通过简单的 HTTP 请求轻松触发。\n\n这款工具特别适合后端开发者、AI 应用构建者以及希望实现批量图像处理的研究人员使用。对于熟悉 Python 或需要搭建自定义绘图服务的团队，它提供了极大的灵活性；而普通用户若希望通过脚本自动执行任务，也能从中受益。\n\n其技术亮点在于完整保留了 Fooocus 的核心特性，包括基于描述的重绘（DescribeImage）、智能图像增强（ImageEnhance）以及多阶段控制网络（ControlNets）支持。特别是在图像增强方面，Fooocus-API 允许通过参数精细控制放大、变异（Upscale\u002FVary）的顺序与强度，并支持结合 GroundingDINO 和 SAM 模型进行基于文本提示的局部遮罩修复。此外，项目提供了 Docker 镜像及多种本地部署方案（如 Conda、venv），大幅降低了环境配置门槛，帮助用户快速在云端或本地服务器中构建稳定的 AI 绘图服务。","[![Docker Image CI](https:\u002F\u002Fgithub.com\u002Fkonieshadow\u002FFooocus-API\u002Factions\u002Fworkflows\u002Fdocker-image.yml\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fkonieshadow\u002FFooocus-API\u002Factions\u002Fworkflows\u002Fdocker-image.yml)\n\n[ English | [中文](\u002FREADME_zh.md) ]\n\n- [Introduction](#introduction)\n  - [Fooocus](#fooocus)\n  - [Fooocus-API](#fooocus-api)\n- [Get-Start](#get-start)\n  - [Run with Replicate](#run-with-replicate)\n  - [Self-hosted](#self-hosted)\n    - [conda](#conda)\n    - [venv](#venv)\n    - [predownload and install](#predownload-and-install)\n    - [already exist Fooocus](#already-exist-fooocus)\n  - [Start with docker](#start-with-docker)\n- [cmd flags](#cmd-flags)\n- [Change log](#change-log)\n- [Apis](#apis)\n- [License](#license)\n- [Thanks :purple\\_heart:](#thanks-purple_heart)\n\n> Note:\n>\n> Although I tested it, I still suggest you test it again before the official update\n>\n> 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.\n>\n> Additionally, `groundingdino-py` may encounter installation errors, especially in Chinese Windows environments. The solution can be found in the following [issue](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FGroundingDINO\u002Fissues\u002F206).\n\n\n> GenerateMask is same as DescribeImage, It is not process as a task, result will directly return\n\n# Instructions for Using the ImageEnhance Interface\nBelow 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.\n\n\n```python\n{\n  \"enhance_input_image\": \"\",\n  \"enhance_checkbox\": true,\n  \"enhance_uov_method\": \"Vary (Strong)\",\n  \"enhance_uov_processing_order\": \"Before First Enhancement\",\n  \"enhance_uov_prompt_type\": \"Original Prompts\",\n  \"save_final_enhanced_image_only\": true,\n  \"enhance_ctrlnets\": [\n    {\n      \"enhance_enabled\": false,\n      \"enhance_mask_dino_prompt\": \"face\",\n      \"enhance_prompt\": \"\",\n      \"enhance_negative_prompt\": \"\",\n      \"enhance_mask_model\": \"sam\",\n      \"enhance_mask_cloth_category\": \"full\",\n      \"enhance_mask_sam_model\": \"vit_b\",\n      \"enhance_mask_text_threshold\": 0.25,\n      \"enhance_mask_box_threshold\": 0.3,\n      \"enhance_mask_sam_max_detections\": 0,\n      \"enhance_inpaint_disable_initial_latent\": false,\n      \"enhance_inpaint_engine\": \"v2.6\",\n      \"enhance_inpaint_strength\": 1,\n      \"enhance_inpaint_respective_field\": 0.618,\n      \"enhance_inpaint_erode_or_dilate\": 0,\n      \"enhance_mask_invert\": false\n    }\n  ]\n}\n```\n\n- enhance_input_image: The image to be enhanced, which is required and can be provided as an image URL for the V2 interface.\n- enhance_checkbox: A toggle switch that must be set to true if you want to use the enhance image feature.\n- 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.\n\nThere are three parameters related to UpscaleVary, which are used to perform Upscale or Vary before or after enhancement.\n\n- enhance_uov_method: Similar to the UpscaleOrVary interface, Disabled turns it off.\n- enhance_uov_processing_order: Determines whether to process the image before or after enhancement.\n- enhance_uov_prompt_type: I'm not sure about the specific function; you might want to research it based on the WebUI.\n\nThe `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:\n\n- enhance_enabled: This parameter controls whether the enhance controller is active. If there are no enabled enhance controllers, the task will be skipped.\n- 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.\n\n\n# Introduction\n\nFastAPI powered API for [Fooocus](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus).\n\nCurrently loaded Fooocus version: [2.3.0](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus\u002Fblob\u002Fmain\u002Fupdate_log.md).\n\n## Fooocus\n\nThis part from [Fooocus](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus) project.\n\nFooocus is an image generating software (based on [Gradio](https:\u002F\u002Fwww.gradio.app\u002F)).\n\nFooocus is a rethinking of Stable Diffusion and Midjourney’s designs:\n\n- Learned from Stable Diffusion, the software is offline, open source, and free.\n\n- Learned from Midjourney, the manual tweaking is not needed, and users only need to focus on the prompts and images.\n\nFooocus has included and automated lots of inner optimizations and quality improvements. 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\"\n\n## Fooocus-API\n\nI think you must have tried to use [Gradio client](https:\u002F\u002Fwww.gradio.app\u002Fdocs\u002Fclient) to call Fooocus, which was a terrible experience for me. \n\nFooocus API uses [FastAPI](https:\u002F\u002Ffastapi.tiangolo.com\u002F)  provides the `REST` API for using Fooocus. Now, you can use Fooocus's powerful ability in any language you like. \n\nIn addition, we also provide detailed [documentation](\u002Fdocs\u002Fapi_doc_en.md) and [sample code](\u002Fexamples)\n\n# Get-Start\n\n## Run with Replicate\n\nNow you can use Fooocus-API by Replicate, the model is on [konieshadow\u002Ffooocus-api](https:\u002F\u002Freplicate.com\u002Fkonieshadow\u002Ffooocus-api).\n\nWith preset:\n\n- [konieshadow\u002Ffooocus-api-anime](https:\u002F\u002Freplicate.com\u002Fkonieshadow\u002Ffooocus-api-anime)\n- [konieshadow\u002Ffooocus-api-realistic](https:\u002F\u002Freplicate.com\u002Fkonieshadow\u002Ffooocus-api-realistic)\n\nI believe this is the easiest way to generate image with Fooocus's power.\n\n## Self-hosted\n\nYou need python version >= 3.10, or use conda to create a new env.\n\nThe hardware requirements are what Fooocus needs. You can find detail [here](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus#minimal-requirement)\n\n### conda\n\nYou can easily start app follow this step use conda:\n\n```shell\nconda env create -f environment.yaml\nconda activate fooocus-api\n```\n\nand then, run `python main.py` to start app, default, server is listening on `http:\u002F\u002F127.0.0.1:8888`\n\n> If you are running the project for the first time, you may have to wait for a while, during which time the program will complete the rest of the installation and download the necessary models. You can also do these steps manually, which I'll mention later.\n\n### venv\n\nSimilar to using conda, create a virtual environment, and then start and wait for a while\n\n```powershell\n# windows\npython -m venv venv\n.\\venv\\Scripts\\Activate\n```\n\n```shell\n# linux\npython -m venv venv\nsource venv\u002Fbin\u002Factivate\n```\nand then, run `python main.py`\n\n### predownload and install\n\nIf you want to deal with environmental problems manually and download the model in advance, you can refer to the following steps\n\nAfter creating a complete environment using conda or venv, you can manually complete the installation of the subsequent environment, just follow\n\nfirst, install requirements: `pip install -r requirements.txt`\n\nthen, pytorch with cuda: `pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121` , you can find more info about this [here](https:\u002F\u002Fpytorch.org\u002Fget-started\u002Fprevious-versions\u002F),\n\n> It is important to note that for pytorch and cuda versions, the recommended version of Fooocus is used, which is currently pytorch2.1.0+cuda12.1. If you insist, you can also use other versions, but you need to add `--skip-pip` when you start app, otherwise the recommended version will be installed automatically\n\nGo to the `repositories` directories, download models and put it into `repositories\\Fooocus\\models`\n\nIf you have Fooocus installed, see [already-exist-fooocus](#already-exist-fooocus)\n\nhere is a list need to download for startup (for different [startup params](#cmd-flags) maybe difference):\n\n- checkpoint:  path to `repositories\\Fooocus\\models\\checkpoints`\n    + [juggernautXL_version6Rundiffusion.safetensors](https:\u002F\u002Fhuggingface.co\u002Flllyasviel\u002Ffav_models\u002Fresolve\u002Fmain\u002Ffav\u002FjuggernautXL_version6Rundiffusion.safetensors)\n\n- vae_approx: path to `repositories\\Fooocus\\models\\vae_approx`\n    + [xlvaeapp.pth](https:\u002F\u002Fhuggingface.co\u002Flllyasviel\u002Fmisc\u002Fresolve\u002Fmain\u002Fxlvaeapp.pth)\n    + [vaeapp_sd15.pth](https:\u002F\u002Fhuggingface.co\u002Flllyasviel\u002Fmisc\u002Fresolve\u002Fmain\u002Fvaeapp_sd15.pt)\n    + [xl-to-v1_interposer-v3.1.safetensors](https:\u002F\u002Fhuggingface.co\u002Flllyasviel\u002Fmisc\u002Fresolve\u002Fmain\u002Fxl-to-v1_interposer-v3.1.safetensors)\n\n- lora: path to `repositories\\Fooocus\\models\\loras`\n    + [sd_xl_offset_example-lora_1.0.safetensors](https:\u002F\u002Fhuggingface.co\u002Fstabilityai\u002Fstable-diffusion-xl-base-1.0\u002Fresolve\u002Fmain\u002Fsd_xl_offset_example-lora_1.0.safetensors?download=true)\n\n> I've uploaded the model I'm using, which contains almost all the base models that Fooocus will use! I put it [here](https:\u002F\u002Fwww.123pan.com\u002Fs\u002FdF5A-SIQsh.html) 提取码: `D4Mk`\n\n### already exist Fooocus\n\nIf you already have Fooocus installed, and it is work well, The recommended way is to reuse models, you just simple copy `config.txt` file from your local Fooocus folder to Fooocus-API root folder. See [Customization](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus#customization) for details.\n\nUse this method you will have both Fooocus and Fooocus-API running at the same time. And they operate independently and do not interfere with each other.\n\n> Do not copy Fooocus to repositories directory\n\n## Start with docker\n\nBefore use docker with GPU, you should [install NVIDIA Container Toolkit](https:\u002F\u002Fdocs.nvidia.com\u002Fdatacenter\u002Fcloud-native\u002Fcontainer-toolkit\u002Flatest\u002Finstall-guide.html) first.\n\nRun\n\n```shell\ndocker run -d --gpus=all \\\n    -e NVIDIA_DRIVER_CAPABILITIES=compute,utility \\\n    -e NVIDIA_VISIBLE_DEVICES=all \\\n    -p 8888:8888 konieshadow\u002Ffooocus-api\n```\n\nFor a more complex usage:\n\n```shell\nmkdir ~\u002Frepositories\nmkdir -p ~\u002F.cache\u002Fpip\n\ndocker run -d --gpus=all \\\n    -e NVIDIA_DRIVER_CAPABILITIES=compute,utility \\\n    -e NVIDIA_VISIBLE_DEVICES=all \\\n    -v ~\u002Frepositories:\u002Fapp\u002Frepositories \\\n    -v ~\u002F.cache\u002Fpip:\u002Froot\u002F.cache\u002Fpip \\\n    -p 8888:8888 konieshadow\u002Ffooocus-api\n```\n\nIt will be persistent the dependent repositories and pip cache.\n\nYou can add `-e PIP_INDEX_URL={pypi-mirror-url}` to docker run command to change pip index url.\n\n> From version 0.4.0.0, Full environment include in docker image, mapping `models` or project root if you needed\n> For example:\n> ```\n> docker run -d --gpus all \\\n>     -v \u002FFooocus-API:\u002Fapp \\\n>     -p 8888:8888 konieshadow\u002Ffooocus-api\n>```\n\n# cmd flags\n\n- `-h, --help` show this help message and exit\n- `--port PORT` Set the listen port, default: 8888\n- `--host HOST` Set the listen host, default: 127.0.0.1\n- `--base-url BASE_URL` Set base url for outside visit, default is http:\u002F\u002Fhost:port\n- `--log-level LOG_LEVEL` Log info for Uvicorn, default: info\n- `--skip-pip` Skip automatic pip install when setup\n- `--preload-pipeline` Preload pipeline before start http server\n- `--queue-size QUEUE_SIZE` Working queue size, default: 100, generation requests exceeding working queue size will return failure\n- `--queue-history QUEUE_HISTORY` Finished jobs reserve size, tasks exceeding the limit will be deleted, including output image files, default: 0, means no limit\n- `--webhook-url WEBHOOK_URL` Webhook url for notify generation result, default: None\n- `--persistent` Store history to db\n- `--apikey APIKEY` Set apikey to enable secure api, default: None\n\nSince v0.3.25, added CMD flags support of Fooocus. You can pass any argument which Fooocus supported.\n\nFor example, to startup image generation (need more vRAM):\n\n```\npython main.py --all-in-fp16 --always-gpu\n```\n\nFor Fooocus CMD flags, see [here](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus?tab=readme-ov-file#all-cmd-flags).\n\n\n# Change log\n\n[CHANGELOG](.\u002Fdocs\u002Fchange_logs.md)\n\nolder change history you can find in [release page](https:\u002F\u002Fgithub.com\u002Fkonieshadow\u002FFooocus-API\u002Freleases)\n\n\n# Apis\n\nyou can find all api detail [here](\u002Fdocs\u002Fapi_doc_en.md)\n\n# License\n\nThis repository is licensed under the [GUN General Public License v3.0](https:\u002F\u002Fgithub.com\u002Fmrhan1993\u002FFooocus-API\u002Fblob\u002Fmain\u002FLICENSE)\n\nThe default checkpoint is published by [RunDiffusion](https:\u002F\u002Fhuggingface.co\u002FRunDiffusion), is licensed under the [CreativeML Open RAIL-M](https:\u002F\u002Fgithub.com\u002Fmrhan1993\u002FFooocus-API\u002Fblob\u002Fmain\u002FCreativeMLOpenRAIL-M).\n\nor, you can find it [here](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FCompVis\u002Fstable-diffusion-license)\n\n# Thanks :purple_heart:\n\nThanks for all your contributions and efforts towards improving the Fooocus API. We thank you for being part of our :sparkles: community :sparkles:!\n","[![Docker镜像CI](https:\u002F\u002Fgithub.com\u002Fkonieshadow\u002FFooocus-API\u002Factions\u002Fworkflows\u002Fdocker-image.yml\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fkonieshadow\u002FFooocus-API\u002Factions\u002Fworkflows\u002Fdocker-image.yml)\n\n[ 英文 | [中文](\u002FREADME_zh.md) ]\n\n- [简介](#introduction)\n  - [Fooocus](#fooocus)\n  - [Fooocus-API](#fooocus-api)\n- [快速开始](#get-start)\n  - [通过Replicate运行](#run-with-replicate)\n  - [自托管](#self-hosted)\n    - [conda](#conda)\n    - [venv](#venv)\n    - [预下载并安装](#predownload-and-install)\n    - [已存在Fooocus](#already-exist-fooocus)\n  - [使用Docker启动](#start-with-docker)\n- [命令行参数](#cmd-flags)\n- [更新日志](#change-log)\n- [API列表](#apis)\n- [许可证](#license)\n- [致谢 :purple_heart:](#thanks-purple_heart)\n\n> 注意：\n>\n> 尽管我已经进行了测试，但我仍然建议您在正式更新之前再次进行测试。\n>\n> Fooocus 2.5 包含重大更新，大多数依赖项都已升级。因此，在更新后，请不要使用 `--skip-pip` 选项，除非您已经手动完成了更新。\n>\n> 此外，`groundingdino-py` 在安装时可能会遇到错误，尤其是在中文 Windows 环境下。解决方案可以在以下 [issue](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FGroundingDINO\u002Fissues\u002F206) 中找到。\n\n\n> GenerateMask 与 DescribeImage 相同，它不会作为一个任务来处理，结果会直接返回。\n\n# ImageEnhance 接口使用说明\n以下是包含 ImageEnhance 所需主要参数的示例。V1 接口采用了类似于 ImagePrompt 的表单式设计，将增强控制器分解开来。\n\n\n```python\n{\n  \"enhance_input_image\": \"\",\n  \"enhance_checkbox\": true,\n  \"enhance_uov_method\": \"Vary (Strong)\",\n  \"enhance_uov_processing_order\": \"Before First Enhancement\",\n  \"enhance_uov_prompt_type\": \"Original Prompts\",\n  \"save_final_enhanced_image_only\": true,\n  \"enhance_ctrlnets\": [\n    {\n      \"enhance_enabled\": false,\n      \"enhance_mask_dino_prompt\": \"face\",\n      \"enhance_prompt\": \"\",\n      \"enhance_negative_prompt\": \"\",\n      \"enhance_mask_model\": \"sam\",\n      \"enhance_mask_cloth_category\": \"full\",\n      \"enhance_mask_sam_model\": \"vit_b\",\n      \"enhance_mask_text_threshold\": 0.25,\n      \"enhance_mask_box_threshold\": 0.3,\n      \"enhance_mask_sam_max_detections\": 0,\n      \"enhance_inpaint_disable_initial_latent\": false,\n      \"enhance_inpaint_engine\": \"v2.6\",\n      \"enhance_inpaint_strength\": 1,\n      \"enhance_inpaint_respective_field\": 0.618,\n      \"enhance_inpaint_erode_or_dilate\": 0,\n      \"enhance_mask_invert\": false\n    }\n  ]\n}\n```\n\n- enhance_input_image：需要增强的图像，这是必填项，对于 V2 接口可以提供图片 URL。\n- enhance_checkbox：一个开关，如果您想使用增强图像功能，则必须将其设置为 true。\n- save_final_enhanced_image_only：由于图像增强是一个流水线操作，可能会生成多张结果图像，此参数允许您只返回最终的增强图像。\n\n与 UpscaleVary 相关的有三个参数，用于在增强之前或之后执行 Upscale 或 Vary 操作。\n\n- enhance_uov_method：与 UpscaleOrVary 接口类似，Disabled 表示关闭该功能。\n- enhance_uov_processing_order：决定是在增强之前还是之后处理图像。\n- enhance_uov_prompt_type：我不太确定其具体功能，您可以根据 WebUI 进行进一步研究。\n\n`enhance_ctrlnets` 元素是一个 ImageEnhance 控制器对象的列表，列表中最多可包含三个元素，多余的元素将被忽略。这些参数大致对应于 WebUI，其中值得注意的参数有：\n\n- enhance_enabled：此参数控制增强控制器是否启用。如果没有启用的增强控制器，任务将被跳过。\n- enhance_mask_dino_prompt：此参数是必需的，用于指示需要增强的区域。如果为空，即使启用了增强控制器，任务也会被跳过。\n\n\n# 简介\n\n基于 FastAPI 的 API，用于 [Fooocus](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus)。\n\n当前加载的 Fooocus 版本：[2.3.0](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus\u002Fblob\u002Fmain\u002Fupdate_log.md)。\n\n## Fooocus\n\n这部分内容来自 [Fooocus](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus) 项目。\nFooocus 是一款基于 [Gradio](https:\u002F\u002Fwww.gradio.app\u002F) 的图像生成软件。\nFooocus 重新思考了 Stable Diffusion 和 Midjourney 的设计理念：\n\n- 借鉴 Stable Diffusion，该软件是离线、开源且免费的。\n- 借鉴 Midjourney，无需手动调整参数，用户只需专注于提示词和图像即可。\nFooocus 内置并自动化了许多内部优化和质量提升功能。用户可以不再关注那些复杂的技术参数，而只需享受人机交互带来的乐趣，从而“探索新的思维媒介，拓展人类的想象力”。\n\n## Fooocus-API\n\n我想您一定尝试过使用 [Gradio 客户端](https:\u002F\u002Fwww.gradio.app\u002Fdocs\u002Fclient) 来调用 Fooocus，但对我来说那是一次非常糟糕的体验。\nFooocus API 使用 [FastAPI](https:\u002F\u002Ffastapi.tiangolo.com\u002F) 提供了用于调用 Fooocus 的 `REST` API。现在，您可以使用任何您喜欢的语言来利用 Fooocus 的强大功能。\n此外，我们还提供了详细的 [文档](\u002Fdocs\u002Fapi_doc_en.md) 和 [示例代码](\u002Fexamples)。\n\n# 快速开始\n\n## 通过 Replicate 运行\n现在您可以通过 Replicate 使用 Fooocus-API，模型位于 [konieshadow\u002Ffooocus-api](https:\u002F\u002Freplicate.com\u002Fkonieshadow\u002Ffooocus-api)。\n预设配置包括：\n- [konieshadow\u002Ffooocus-api-anime](https:\u002F\u002Freplicate.com\u002Fkonieshadow\u002Ffooocus-api-anime)\n- [konieshadow\u002Ffooocus-api-realistic](https:\u002F\u002Freplicate.com\u002Fkonieshadow\u002Ffooocus-api-realistic)\n\n我认为这是利用 Fooocus 功能生成图像的最简单方式。\n\n## 自托管\n您需要 Python 3.10 或更高版本，或者使用 conda 创建一个新的环境。\n硬件要求与 Fooocus 相同。详细信息请参见 [此处](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus#minimal-requirement)。\n\n### conda\n您可以按照以下步骤轻松使用 conda 启动应用：\n\n```shell\nconda env create -f environment.yaml\nconda activate fooocus-api\n```\n\n然后运行 `python main.py` 启动应用，默认情况下，服务器会监听 `http:\u002F\u002F127.0.0.1:8888`。\n> 如果您是第一次运行该项目，可能需要等待一段时间，在此期间程序将完成剩余的安装并下载必要的模型。您也可以手动完成这些步骤，稍后我会提到。 \n\n### venv\n与使用 conda 类似，创建一个虚拟环境，然后启动并等待一段时间。\n\n```powershell\n# windows\npython -m venv venv\n.\\venv\\Scripts\\Activate\n```\n\n```shell\n# linux\npython -m venv venv\nsource venv\u002Fbin\u002Factivate\n```\n\n然后运行 `python main.py`\n\n### 预先下载并安装\n\n如果您希望手动处理环境问题并提前下载模型，可以参考以下步骤：\n\n使用 conda 或 venv 创建完整环境后，您可以手动完成后续环境的安装，只需按照以下步骤操作：\n\n首先，安装依赖：`pip install -r requirements.txt`\n\n然后，安装带有 CUDA 的 PyTorch：`pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121`。有关更多信息，请参阅 [此处](https:\u002F\u002Fpytorch.org\u002Fget-started\u002Fprevious-versions\u002F)。\n\n> 请注意，对于 PyTorch 和 CUDA 的版本，建议使用 Fooocus 推荐的版本，即当前的 PyTorch 2.1.0 + CUDA 12.1。如果您坚持使用其他版本，在启动应用时需要添加 `--skip-pip` 参数，否则系统会自动安装推荐版本。\n\n进入 `repositories` 目录，下载模型并将其放入 `repositories\\Fooocus\\models` 文件夹中。\n\n如果您已经安装了 Fooocus，请参阅 [already-exist-fooocus](#already-exist-fooocus)。\n\n以下是启动时需要下载的文件列表（根据不同的 [启动参数](#cmd-flags) 可能有所不同）：\n\n- 检查点：路径为 `repositories\\Fooocus\\models\\checkpoints`\n    + [juggernautXL_version6Rundiffusion.safetensors](https:\u002F\u002Fhuggingface.co\u002Flllyasviel\u002Ffav_models\u002Fresolve\u002Fmain\u002Ffav\u002FjuggernautXL_version6Rundiffusion.safetensors)\n\n- 近似 VAE：路径为 `repositories\\Fooocus\\models\\vae_approx`\n    + [xlvaeapp.pth](https:\u002F\u002Fhuggingface.co\u002Flllyasviel\u002Fmisc\u002Fresolve\u002Fmain\u002Fxlvaeapp.pth)\n    + [vaeapp_sd15.pth](https:\u002F\u002Fhuggingface.co\u002Flllyasviel\u002Fmisc\u002Fresolve\u002Fmain\u002Fvaeapp_sd15.pt)\n    + [xl-to-v1_interposer-v3.1.safetensors](https:\u002F\u002Fhuggingface.co\u002Flllyasviel\u002Fmisc\u002Fresolve\u002Fmain\u002Fxl-to-v1_interposer-v3.1.safetensors)\n\n- LoRA：路径为 `repositories\\Fooocus\\models\\loras`\n    + [sd_xl_offset_example-lora_1.0.safetensors](https:\u002F\u002Fhuggingface.co\u002Fstabilityai\u002Fstable-diffusion-xl-base-1.0\u002Fresolve\u002Fmain\u002Fsd_xl_offset_example-lora_1.0.safetensors?download=true)\n\n> 我已上传我正在使用的模型，其中包含了 Fooocus 将要使用的所有基础模型！您可以从 [这里](https:\u002F\u002Fwww.123pan.com\u002Fs\u002FdF5A-SIQsh.html) 下载，提取码为：`D4Mk`。\n\n### 已存在 Fooocus\n\n如果您已经安装了 Fooocus，并且运行良好，推荐的方式是复用现有模型。您只需将本地 Fooocus 文件夹中的 `config.txt` 文件复制到 Fooocus-API 的根目录即可。详细信息请参阅 [Customization](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus#customization)。\n\n使用此方法，您可以同时运行 Fooocus 和 Fooocus-API，两者独立运作，互不干扰。\n\n> 请勿将 Fooocus 复制到 `repositories` 目录下。\n\n## 使用 Docker 启动\n\n在使用带有 GPU 的 Docker 之前，您应先 [安装 NVIDIA Container Toolkit](https:\u002F\u002Fdocs.nvidia.com\u002Fdatacenter\u002Fcloud-native\u002Fcontainer-toolkit\u002Flatest\u002Finstall-guide.html)。\n\n运行以下命令：\n\n```shell\ndocker run -d --gpus=all \\\n    -e NVIDIA_DRIVER_CAPABILITIES=compute,utility \\\n    -e NVIDIA_VISIBLE_DEVICES=all \\\n    -p 8888:8888 konieshadow\u002Ffooocus-api\n```\n\n对于更复杂的使用场景：\n\n```shell\nmkdir ~\u002Frepositories\nmkdir -p ~\u002F.cache\u002Fpip\n\ndocker run -d --gpus=all \\\n    -e NVIDIA_DRIVER_CAPABILITIES=compute,utility \\\n    -e NVIDIA_VISIBLE_DEVICES=all \\\n    -v ~\u002Frepositories:\u002Fapp\u002Frepositories \\\n    -v ~\u002F.cache\u002Fpip:\u002Froot\u002F.cache\u002Fpip \\\n    -p 8888:8888 konieshadow\u002Ffooocus-api\n```\n\n这样可以持久化依赖的仓库和 pip 缓存。\n\n您还可以在 docker run 命令中添加 `-e PIP_INDEX_URL={pypi-mirror-url}` 来更改 pip 的索引地址。\n\n> 从版本 0.4.0.0 开始，Docker 镜像中已包含完整的环境，如有需要，可映射 `models` 或项目根目录。\n> 例如：\n> ```\n> docker run -d --gpus all \\\n>     -v \u002FFooocus-API:\u002Fapp \\\n>     -p 8888:8888 konieshadow\u002Ffooocus-api\n>```\n\n# 命令行参数\n\n- `-h, --help` 显示帮助信息并退出\n- `--port PORT` 设置监听端口，默认为 8888\n- `--host HOST` 设置监听主机，默认为 127.0.0.1\n- `--base-url BASE_URL` 设置外部访问的基础 URL，默认为 http:\u002F\u002Fhost:port\n- `--log-level LOG_LEVEL` 设置 Uvicorn 的日志级别，默认为 info\n- `--skip-pip` 在设置时跳过自动 pip 安装\n- `--preload-pipeline` 在启动 HTTP 服务器前预加载管道\n- `--queue-size QUEUE_SIZE` 工作队列大小，默认为 100，超出工作队列大小的生成请求将返回失败\n- `--queue-history QUEUE_HISTORY` 已完成任务的保留数量，超过限制的任务将被删除，包括输出图像文件，默认为 0，表示无限制\n- `--webhook-url WEBHOOK_URL` 用于通知生成结果的 webhook 地址，默认为 None\n- `--persistent` 将历史记录存储到数据库中\n- `--apikey APIKEY` 设置 API 密钥以启用安全 API，默认为 None\n\n自 v0.3.25 起，新增了对 Fooocus 命令行参数的支持。您可以传递任何 Fooocus 支持的参数。\n\n例如，要启动图像生成（需要更多显存）：\n\n```\npython main.py --all-in-fp16 --always-gpu\n```\n\n有关 Fooocus 的命令行参数，请参阅 [此处](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus?tab=readme-ov-file#all-cmd-flags)。\n\n# 更改日志\n\n[CHANGELOG](.\u002Fdocs\u002Fchange_logs.md)\n\n更早的更改历史可以在 [发布页面](https:\u002F\u002Fgithub.com\u002Fkonieshadow\u002FFooocus-API\u002Freleases) 中找到。\n\n# API\n\n所有 API 的详细信息请参阅 [此处](\u002Fdocs\u002Fapi_doc_en.md)。\n\n# 许可证\n\n本仓库采用 [GNU 通用公共许可证 v3.0](https:\u002F\u002Fgithub.com\u002Fmrhan1993\u002FFooocus-API\u002Fblob\u002Fmain\u002FLICENSE) 许可。\n\n默认的检查点由 [RunDiffusion](https:\u002F\u002Fhuggingface.co\u002FRunDiffusion) 发布，采用 [CreativeML Open RAIL-M](https:\u002F\u002Fgithub.com\u002Fmrhan1993\u002FFooocus-API\u002Fblob\u002Fmain\u002FCreativeMLOpenRAIL-M) 许可。\n\n或者，您也可以在 [这里](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FCompVis\u002Fstable-diffusion-license) 找到相关信息。\n\n# 感谢 :purple_heart:\n\n感谢各位为改进 Fooocus API 所做出的贡献和努力。我们感谢您成为我们 :sparkles: 社区 :sparkles:!","# Fooocus-API 快速上手指南\n\nFooocus-API 是基于 FastAPI 构建的 RESTful 接口，旨在让开发者能够通过代码轻松调用 [Fooocus](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus) 强大的图像生成能力，摆脱 Gradio 客户端的限制。\n\n## 1. 环境准备\n\n### 系统要求\n- **Python 版本**: >= 3.10\n- **操作系统**: Windows \u002F Linux \u002F macOS\n- **硬件要求**: 与 Fooocus 一致（推荐 NVIDIA GPU，显存建议 8GB 以上）。\n  - 详细硬件要求参考：[Fooocus Minimal Requirement](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus#minimal-requirement)\n\n### 前置依赖\n- **NVIDIA Container Toolkit** (仅 Docker 模式需要): 用于支持 GPU 加速。\n- **Git**: 用于克隆项目代码。\n\n## 2. 安装步骤\n\n你可以选择以下任意一种方式进行部署：\n\n### 方式一：使用 Conda 安装（推荐）\n\n```bash\n# 1. 创建虚拟环境\nconda env create -f environment.yaml\n\n# 2. 激活环境\nconda activate fooocus-api\n\n# 3. 启动服务\n# 首次运行会自动下载模型和依赖，可能需要等待一段时间\npython main.py\n```\n\n### 方式二：使用 venv 安装\n\n**Windows:**\n```powershell\npython -m venv venv\n.\\venv\\Scripts\\Activate\npip install -r requirements.txt\n# 安装 CUDA 版 PyTorch (推荐版本：2.1.0 + cu121)\npip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\npython main.py\n```\n\n**Linux:**\n```bash\npython -m venv venv\nsource venv\u002Fbin\u002Factivate\npip install -r requirements.txt\npip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\npython main.py\n```\n\n> **手动预下载模型提示**：\n> 若需手动下载模型以避免自动下载失败，请将模型放入 `repositories\u002FFooocus\u002Fmodels` 对应目录。\n> 国内用户可使用作者提供的整合包加速下载：[123pan 下载链接](https:\u002F\u002Fwww.123pan.com\u002Fs\u002FdF5A-SIQsh.html) (提取码: `D4Mk`)。\n\n### 方式三：使用 Docker 启动（最简便）\n\n确保已安装 NVIDIA Container Toolkit，然后运行：\n\n```bash\ndocker run -d --gpus=all \\\n    -e NVIDIA_DRIVER_CAPABILITIES=compute,utility \\\n    -e NVIDIA_VISIBLE_DEVICES=all \\\n    -p 8888:8888 konieshadow\u002Ffooocus-api\n```\n\n**持久化存储配置（推荐）：**\n将模型目录和 pip 缓存映射到宿主机，避免重复下载：\n\n```bash\nmkdir ~\u002Frepositories\nmkdir -p ~\u002F.cache\u002Fpip\n\ndocker run -d --gpus=all \\\n    -e NVIDIA_DRIVER_CAPABILITIES=compute,utility \\\n    -e NVIDIA_VISIBLE_DEVICES=all \\\n    -v ~\u002Frepositories:\u002Fapp\u002Frepositories \\\n    -v ~\u002F.cache\u002Fpip:\u002Froot\u002F.cache\u002Fpip \\\n    -p 8888:8888 konieshadow\u002Ffooocus-api\n```\n\n## 3. 基本使用\n\n服务默认启动在 `http:\u002F\u002F127.0.0.1:8888`。你可以通过发送 POST 请求调用 API。\n\n### 最简单的文生图示例\n\n以下是一个使用 `curl` 调用基础文生图接口的示例：\n\n```bash\ncurl -X POST \"http:\u002F\u002F127.0.0.1:8888\u002Fv1\u002Fgeneration\u002Ftext-to-image\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"prompt\": \"a beautiful girl with long hair, cyberpunk style, high quality\",\n    \"negative_prompt\": \"\",\n    \"style_selections\": [\"Fooocus V2\"],\n    \"performance_selection\": \"Speed\",\n    \"aspect_ratios_selection\": \"1152*896\",\n    \"image_number\": 1,\n    \"seed\": -1,\n    \"read_wildcards_in_order\": false,\n    \"sharpness\": 2.0,\n    \"guidance_scale\": 4.0,\n    \"base_model_name\": \"juggernautXL_version6Rundiffusion.safetensors\",\n    \"refiner_model_name\": \"None\",\n    \"refiner_switch\": 0.5,\n    \"lora_selection\": [],\n    \"input_image_checkbox\": false\n  }'\n```\n\n### 图像增强示例 (ImageEnhance)\n\n若需使用图像增强功能，需设置 `enhance_checkbox` 为 `true` 并提供输入图片：\n\n```json\n{\n  \"enhance_input_image\": \"https:\u002F\u002Fexample.com\u002Fimage.jpg\",\n  \"enhance_checkbox\": true,\n  \"enhance_uov_method\": \"Vary (Strong)\",\n  \"save_final_enhanced_image_only\": true,\n  \"enhance_ctrlnets\": [\n    {\n      \"enhance_enabled\": true,\n      \"enhance_mask_dino_prompt\": \"face\",\n      \"enhance_mask_model\": \"sam\",\n      \"enhance_inpaint_engine\": \"v2.6\",\n      \"enhance_inpaint_strength\": 1\n    }\n  ]\n}\n```\n\n### 常用启动参数\n\n你可以通过命令行参数自定义服务行为：\n\n- `--port`: 设置监听端口 (默认 8888)\n- `--host`: 设置监听地址 (默认 127.0.0.1)\n- `--apikey`: 设置 API Key 以启用安全验证\n- `--skip-pip`: 跳过启动时的自动 pip 安装（适用于已手动更新依赖的情况）\n- `--preload-pipeline`: 启动时预加载模型管线\n\n示例：\n```bash\npython main.py --port 9000 --apikey my-secret-key --all-in-fp16\n```\n\n> **注意**: Fooocus 2.5+ 版本更新了大部分依赖，更新后除非已手动处理，否则请勿使用 `--skip-pip`。","某电商设计团队需要将数百张商品模特图批量进行高清重绘与局部细节优化，以适配不同营销渠道的展示需求。\n\n### 没有 Fooocus-API 时\n- 设计师必须人工登录 Fooocus 网页界面，逐张上传图片并手动勾选“高清修复”与“局部重绘”选项，效率极低且无法夜间无人值守运行。\n- 面对复杂的局部增强需求（如仅重绘面部或衣物），每次都需要手动调整 GroundingDINO 提示词和 SAM 掩码参数，操作繁琐且容易出错。\n- 难以将图像增强流程嵌入现有的订单处理系统，导致从“收到修图需求”到“交付成品”之间存在数小时的人工等待断层。\n- 批量处理时若中途报错，缺乏自动重试机制，往往需要人工介入检查日志并重新开始任务，浪费大量算力资源。\n\n### 使用 Fooocus-API 后\n- 开发团队通过 FastAPI 接口编写脚本，一键提交包含 `enhance_input_image` 和 `enhance_checkbox` 的 JSON 请求，实现数百张图片的自动化队列处理。\n- 利用 `enhance_ctrlnets` 参数列表，在代码中精准预设 `enhance_mask_dino_prompt`（如\"face\"或\"coat\"），自动完成特定区域的智能掩码生成与高质量重绘。\n- 将 API 无缝集成至内部 CMS 系统，运营人员上传原图后系统自动触发增强流程，并通过 `save_final_enhanced_image_only` 直接返回最终成品，实现秒级响应。\n- 结合 Docker 部署方案，服务具备稳定的错误处理与重试逻辑，即使在高并发下也能确保任务完整执行，无需人工干预。\n\nFooocus-API 将原本依赖人工点击的复杂图像增强工作流，转化为可编程、可集成的自动化生产线，极大提升了视觉内容的产出效率与一致性。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmrhan1993_Fooocus-API_1a4f224c.png","mrhan1993","NULL","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmrhan1993_c98f4bcd.jpg","HangZhou","China",null,"aiyinsi-tan@163.com","https:\u002F\u002Fgithub.com\u002Fmrhan1993",[83,87],{"name":84,"color":85,"percentage":86},"Python","#3572A5",100,{"name":88,"color":89,"percentage":90},"Dockerfile","#384d54",0,659,185,"2026-04-09T10:36:43","GPL-3.0","Linux, Windows","必需 NVIDIA GPU (支持 CUDA)，具体显存需求取决于 Fooocus 主项目 (通常建议 8GB+)，推荐 CUDA 12.1","未说明 (取决于 Fooocus 主项目)",{"notes":99,"python":100,"dependencies":101},"1. 硬件需求与 Fooocus 主项目一致。2. 推荐使用 conda 或 venv 创建环境。3. 首次运行会自动下载模型，也可手动预下载。4. Windows 中文环境下安装 'groundingdino-py' 可能报错，需参考特定 Issue 解决。5. 更新到 Fooocus 2.5+ 后，除非已手动更新依赖，否则启动时不要使用 '--skip-pip' 参数。6. 支持 Docker 部署，需预先安装 NVIDIA Container Toolkit。","3.10+",[102,103,104,105,106,107],"torch==2.1.0","torchvision==0.16.0","torchaudio==2.1.0","fastapi","uvicorn","groundingdino-py",[15],[110,111,112,113],"comfyui","stable-diffusion","fooocus","sdxl","2026-03-27T02:49:30.150509","2026-04-19T09:15:01.581032",[],[118,123,128,133,138,143,148,153,158,163,168,173,178,183,188,193,198,203,208,213],{"id":119,"version":120,"summary_zh":121,"released_at":122},334060,"v0.5.0.1","Fooocus 至 v2.5.3","2024-08-15T15:54:46",{"id":124,"version":125,"summary_zh":126,"released_at":127},334061,"v0.4.1.1","合并 Fooocus 2.4.3","2024-07-01T01:33:50",{"id":129,"version":130,"summary_zh":131,"released_at":132},334062,"v0.4.1.0","[更新至 Fooocus 2.4.1](https:\u002F\u002Fgithub.com\u002Fmrhan1993\u002FFooocus-API\u002Fcommit\u002F06cebcecddfc5b47ecce73fb7bd2850015d17a20)","2024-06-25T15:48:49",{"id":134,"version":135,"summary_zh":136,"released_at":137},334063,"v0.4.0.6","修复 clorlog 依赖错误","2024-04-24T03:57:39",{"id":139,"version":140,"summary_zh":141,"released_at":142},334064,"v0.4.0.5","- 修复因拼写错误而必需的 meta_scheme\n- 将 v1 端点同步到最新版本","2024-04-16T05:14:55",{"id":144,"version":145,"summary_zh":146,"released_at":147},334065,"v0.4.0.4","支持保存图像元数据，目前仅支持 PNG 和 Fooocus 方案。  \n可自定义输出图像的文件名。  \n输出图像名称已更改为任务 ID。  \n版本更新。","2024-04-15T10:07:15",{"id":149,"version":150,"summary_zh":151,"released_at":152},334066,"v0.4.0.2","修复 #222\r\n修复 #280","2024-04-09T09:26:46",{"id":154,"version":155,"summary_zh":156,"released_at":157},334067,"v0.4.0.1","- 从 .dockerignore 中移除仓库\n- 修复 parameters.py 中的 default_loras\n- LoRA 支持 Replicate 上的 URL","2024-04-08T06:57:02",{"id":159,"version":160,"summary_zh":161,"released_at":162},334068,"v0.4.0.0","首个集成Fooocus的版本","2024-04-08T03:37:27",{"id":164,"version":165,"summary_zh":166,"released_at":167},334069,"v0.3.33","集成 Fooocus 之前的最后一个版本","2024-04-07T15:28:21",{"id":169,"version":170,"summary_zh":171,"released_at":172},334070,"v0.3.32","support Fooocus to 2.3.0","2024-03-21T15:05:56",{"id":174,"version":175,"summary_zh":176,"released_at":177},334071,"v0.3.31","fix a #245 ","2024-03-21T14:59:48",{"id":179,"version":180,"summary_zh":181,"released_at":182},334072,"v0.3.30","Support larger task queue size, change default queue size to 100.\r\nFix typo 'inpait' to 'inpaint', including api paths.\r\nFix api error for job history when none generation request was executed.","2024-01-26T05:42:56",{"id":184,"version":185,"summary_zh":186,"released_at":187},334073,"v0.3.29","Merged Fooocus v2.1.860","2024-01-04T04:08:02",{"id":189,"version":190,"summary_zh":191,"released_at":192},334074,"v0.3.28","Add a endpoint `\u002Fv2\u002Fgeneration\u002Ftext-to-image-with-ip`, you can use this to generating text2img and applying the generated image at the same time as ImagePrompt","2024-01-03T06:30:13",{"id":194,"version":195,"summary_zh":196,"released_at":197},334075,"v0.3.27","Add query job hitory api.\r\nAdd webhook_url support for each generation request.","2023-12-29T04:18:39",{"id":199,"version":200,"summary_zh":201,"released_at":202},334076,"v0.3.26","Add web-hook cmd flag for notify generation result.\r\nChange async job id to uuid to avoid conflict between each startup.","2023-12-28T02:58:25",{"id":204,"version":205,"summary_zh":206,"released_at":207},334077,"v0.3.25","Add CMD flags support of Fooocus.\r\n\r\nBreak changes from v0.3.25\r\n* Removed cli argument `disable-private-log`. You can use Fooocus's `--disable-image-log` for the same purpose.","2023-12-22T05:58:25",{"id":209,"version":210,"summary_zh":211,"released_at":212},334078,"v0.3.24","Merge for Fooocus v2.1.852.\r\n\r\n* This version merged Fooocus v2.1.839, which include a seed breaking change. Details for [2.1.839](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFooocus\u002Fblob\u002Fmain\u002Fupdate_log.md#21839).","2023-12-19T02:10:44",{"id":214,"version":215,"summary_zh":216,"released_at":217},334079,"v0.3.23","Merge for Fooocus v2.1.837.","2023-12-14T02:37:15"]