跳转到内容

Fooocus

集成

模型 id fooocus
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/fooocus?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": ""
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此请求: ≈$0.444 444 API 积分 在此页面运行

获取 API 密钥
Open model 文生图 #stylized

文生图模型,支持风格预设、LoRA 合并、细化器选项和基于图像的控制模式

Open model · 图像

你的第一个结果将在此显示

在下方构建请求,并使用你的 API 密钥运行。输出会复制到我们的存储中,可永久保存或免费保存 7 天。

构建请求

控件根据模型架构生成。更改控件时,代码和价格会同步更新。

描述要生成的图像;请尽可能提供详细信息以获得最佳结果。

默认 1024x1024

输出图像尺寸,可从预设中选择,或指定自定义宽度和高度。两个自定义尺寸都必须能被 8 整除。

num_images 默认 1

每个请求生成的图像数量。

高级 negative_prompt · control_image_url · inpaint_image_url · mask_image_url · performance · output_format · control_type · refiner_model · guidance_scale · sharpness · refiner_switch · control_image_weight · control_image_stop_at · seed · mixing_image_prompt_and_inpaint · enable_safety_checker · styles · loras
默认

指定要排除的图像细节的负面提示词,包括颜色、物体、场景或更细致的特征。例如胡子、模糊或低分辨率。

拖放文件,或

用于引导图像生成的参考图像。

拖放文件,或

修复期间使用的参考图像。

拖放文件,或

图像生成期间应用的蒙版图像。

performance 默认 Extreme Speed

性能选项:Speed 或 Quality。

output_format 默认 jpeg

结果图像的文件格式。

control_type 默认 PyraCanny

图像控制方法。

默认 None

精修器选择:SDXL 或 SD 1.5。

默认 4

图像选择对提示词的遵循强度,以 CFG(Classifier Free Guidance)表示。

默认 2

输出图像的锐度设置。提高该值会使图像及其纹理更加锐利。

默认 0.8

精修器切换值:真实感 SD1.5 模型使用 0.4,动漫 SD1.5 模型使用 0.667,XL-refiners 使用 0.8。在两个 SDXL 模型之间切换时可使用任意值。

默认 1

控制图像强度,用于确定输出与控制图像之间的相似程度。

默认 1

控制图像停止值,用于控制输出与控制图像的相似程度。

用于在 Stable Diffusion 中复现图像的种子。保持模型版本、提示词和种子不变,即可在每次运行中精确复现图像。

默认 ["Fooocus Enhance","F...

生成期间应用的风格。

默认 [{"path":"https://hug...

合并用于最终图像生成的 LoRA,最多 5 个 LoRA。

POST /run/fooocus?wait=20 报价 → $0.444
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/fooocus?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": ""
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 Fooocus

使用 Fooocus 的默认风格组合根据提示词生成图像。选择 `performance` 模式(Speed、Quality、Extreme Speed、Lightning),设置 `sharpness` 和 `aspect_ratio`,并请求 1 到 4 张图像。最多可合并 5 个 LoRA,可选控制图像支持 ImagePrompt、PyraCanny、CPDS 或 FaceSwap 引导。输出格式为 png、jpeg 或 webp。

参数

发送规范名称或原生名称之一,不要同时发送两者。 规范名称

名称类型 默认值允许值 描述
prompt可选
类型string
默认值
描述要生成的图像;请尽可能提供详细信息以获得最佳结果。
negative_prompt可选
类型string
默认值
指定要排除的图像细节的负面提示词,包括颜色、物体、场景或更细致的特征。例如胡子、模糊或低分辨率。
styles可选
类型enum[]
默认值["Fooocus Enhance","Fooocus Sharp","Fooocus V2"]
生成期间应用的风格。
performance可选
类型enum
默认值Extreme Speed
SpeedQualityExtreme SpeedLightning
性能选项:Speed 或 Quality。
guidance_scale可选
类型number
默认值4
1 – 30
图像选择对提示词的遵循强度,以 CFG(Classifier Free Guidance)表示。
sharpness可选
类型number
默认值2
0 – 30
输出图像的锐度设置。提高该值会使图像及其纹理更加锐利。
aspect_ratio可选
类型string
默认值1024x1024
输出图像尺寸,可从预设中选择,或指定自定义宽度和高度。两个自定义尺寸都必须能被 8 整除。
num_images可选 num_outputs
类型integer
默认值1
1 – 4
每个请求生成的图像数量。
loras可选
类型object[]
默认值[{"path":"https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_offset_example-lora_1.0.safetensors","scale":0.1}]
合并用于最终图像生成的 LoRA,最多 5 个 LoRA。
loras[].path必填
类型string
LoRA 权重的位置,以 URL 或路径指定。
loras[].scale可选
类型number
默认值0.1
0 – 1
LoRA 权重合并到基础模型前应用的乘数。
refiner_model可选
类型enum
默认值None
NonerealisticVisionV60B1_v51VAE.safetensors
精修器选择:SDXL 或 SD 1.5。
refiner_switch可选
类型number
默认值0.8
0 – 1
精修器切换值:真实感 SD1.5 模型使用 0.4,动漫 SD1.5 模型使用 0.667,XL-refiners 使用 0.8。在两个 SDXL 模型之间切换时可使用任意值。
output_format可选
类型enum
默认值jpeg
pngjpegwebp
结果图像的文件格式。
seed可选
类型integer | null
用于在 Stable Diffusion 中复现图像的种子。保持模型版本、提示词和种子不变,即可在每次运行中精确复现图像。
control_image_url可选
类型url · image
用于引导图像生成的参考图像。
control_type可选
类型enum
默认值PyraCanny
ImagePromptPyraCannyCPDSFaceSwap
图像控制方法。
control_image_weight可选
类型number
默认值1
0 – 2
控制图像强度,用于确定输出与控制图像之间的相似程度。
control_image_stop_at可选
类型number
默认值1
0 – 1
控制图像停止值,用于控制输出与控制图像的相似程度。
inpaint_image_url可选
类型url · image
修复期间使用的参考图像。
mask_image_url可选
类型url · image
图像生成期间应用的蒙版图像。
mixing_image_prompt_and_inpaint可选
类型boolean
默认值false
enable_safety_checker可选
类型boolean
默认值true
安全检查开关:false 仅在账户获得授权时才会禁用检查。没有该授权的请求始终会经过检查,不安全的图像会被替换为黑色图像。
必填 规范名称,也可接受

文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "fooocus",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 444,
    "usd": "0.444",
    "charged": 444,
    "refunded": 0
  },
  "input": {
    "prompt": ""
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ],
    "timings": {},
    "has_nsfw_concepts": [
      false
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
images
array of object {url, content_type, file_name, file_size, width, height}生成图像的文件信息。
timings
object生成耗时。
has_nsfw_concepts
array of boolean指示生成的图像中是否出现 NSFW 概念。

更多模型:文生图

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/fooocus.md. 所有模型和指南: https://doitong.com/developers/llms.txt