跳至內容

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.ru/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.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此請求: ≈$0.444 444 API 點數 · ≈ ₽47.32 在此頁面執行

取得 API 金鑰
Open model 文字轉圖像 #stylized

支援風格預設、LoRA 合併、refiner 選項和以影像控制模式的文字轉影像生成器

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.ru/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.ru/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.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/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-TW/developers/models/fooocus.md. 所有模型與指南: https://doitong.com/developers/llms.txt