跳至內容

Fooocus Inpainting

整合

模型 id fooocus/inpaint
# 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/inpaint?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inpaint_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# 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.055 55 API 點數 · ≈ ₽5.80 在此頁面執行

取得 API 金鑰
Open model 圖像編輯 #stylized#editing

使用選用的遮罩對影像進行局部重繪或向外擴展,支援細節修正或內容變更模式

Open model · 圖像

您的第一個結果會顯示在這裡

在下方建立請求,並使用您的 API 金鑰執行。輸出會複製到我們的儲存空間,可永久保留或免費保留 7 天。

建立請求

控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。

預設

盡可能詳細地描述想要生成的圖像,以取得最佳結果。

•必填
拖放檔案,或

修補時使用的參考圖像。

預設 1024x1024

輸出圖像尺寸,可從預設值選取或自訂寬度與高度。兩個自訂尺寸都必須可被 8 整除。

num_images 預設 1

每次請求要生成的圖像數量。

進階 negative_prompt · inpaint_additional_prompt · mask_image_url · performance · output_format · inpaint_engine · refiner_model · inpaint_mode · guidance_scale · sharpness · refiner_switch · inpaint_strength · inpaint_respective_field · inpaint_erode_or_dilate · seed · override_inpaint_options · inpaint_disable_initial_latent · invert_mask · mixing_image_prompt_and_inpaint · enable_safety_checker · styles · outpaint_selections · loras · image_prompt_1 · image_prompt_2 · image_prompt_3 · image_prompt_4
預設

指定要排除的圖像細節之負面提示詞,包括色彩、物件、景物或更細微的特徵。例如鬍鬚、模糊或低解析度。

預設

所需修補內容的描述。

拖放檔案,或

圖像生成時套用的遮罩圖像。

performance 預設 Extreme Speed

效能選項:Speed 或 Quality。

output_format 預設 jpeg

生成圖像的檔案格式。

inpaint_engine 預設 v2.6

Fooocus 修補的模型版本。

預設 None

精修模型選擇:SDXL 或 SD 1.5。

預設 Inpaint or Outpaint (...

修補時套用的模式。

預設 4

圖像選取的提示詞遵循強度,以 CFG (Classifier Free Guidance) 表示。

預設 2

輸出圖像的銳利度設定。提高此值會讓圖像及其紋理更銳利。

預設 0.8

精修切換值:寫實 SD1.5 模型使用 0.4,動漫 SD1.5 模型使用 0.667,XL-refiners 使用 0.8。在兩個 SDXL 模型之間切換時可使用任意值。

預設 1

修補的去噪強度,相當於 A1111 的修補設定。不適用於外擴,外擴一律使用 1.0。

預設 0.618

使用 A1111 對應值選取修補區域:"Only Masked" 對應 0,"Whole Image" 對應 1。外擴會忽略此設定,一律使用 1.0。

預設 0

在反轉前調整遮罩的白色區域,預設值為 0。使用正值擴大該區域,負值縮小該區域。

用於在 Stable Diffusion 中重現圖像的種子。只要模型版本、提示詞和種子保持不變,每次執行都能精確重現圖像。

預設 ["Fooocus Enhance","F...

生成時套用的風格。

預設 []

外擴圖像的方向。

預設 [{"path":"https://hug...

合併至最終圖像生成的 LoRA,最多 5 個 LoRA。

POST /run/fooocus/inpaint?wait=20 報價 → $0.055
# 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/inpaint?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inpaint_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# 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 Inpainting

透過重新生成遮罩區域或延伸邊界來編輯現有影像。提供 `inpaint_image_url`,並可選擇提供 `mask_image_url`,再選擇 `inpaint_mode`:一般局部重繪/向外擴展、細節改善或內容修改。也接受 LoRA、最多四個影像提示和 refiner 選擇,每次請求可輸出 1 到 4 張 png、jpeg 或 webp。Strength 和 respective-field 設定可更精細地控制變更幅度。

參數

請傳送標準名稱或原生名稱其中之一,不要同時傳送兩者。 標準名稱

名稱類型 預設值允許值 說明
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 中重現圖像的種子。只要模型版本、提示詞和種子保持不變,每次執行都能精確重現圖像。
inpaint_image_url必填
類型url · image
修補時使用的參考圖像。
mask_image_url選填
類型url · image
圖像生成時套用的遮罩圖像。
inpaint_mode選填
類型enum
預設值Inpaint or Outpaint (default)
Inpaint or Outpaint (default)Improve Detail (face, hand, eyes, etc.)Modify Content (add objects, change background, etc.)
修補時套用的模式。
inpaint_additional_prompt選填
類型string
預設值
所需修補內容的描述。
outpaint_selections選填
類型enum[]
預設值[]
外擴圖像的方向。
override_inpaint_options選填
類型boolean
預設值false
進階修補設定的覆寫切換:`inpaint_disable_initial_latent`、`inpaint_engine`、`inpaint_strength`、`inpaint_respective_field` 和 `inpaint_erode_or_dilate`。設定為 true 會覆寫這些選項,否則套用其預設值。
inpaint_disable_initial_latent選填
類型boolean
預設值false
初始前處理切換:true 會停用該前處理。
inpaint_engine選填
類型enum
預設值v2.6
Nonev1v2.5v2.6
Fooocus 修補的模型版本。
inpaint_strength選填
類型number
預設值1
≤ 1> 0
修補的去噪強度,相當於 A1111 的修補設定。不適用於外擴,外擴一律使用 1.0。
inpaint_respective_field選填
類型number
預設值0.618
0 – 1
使用 A1111 對應值選取修補區域:"Only Masked" 對應 0,"Whole Image" 對應 1。外擴會忽略此設定,一律使用 1.0。
inpaint_erode_or_dilate選填
類型number
預設值0
-64 – 64
在反轉前調整遮罩的白色區域,預設值為 0。使用正值擴大該區域,負值縮小該區域。
invert_mask選填
類型boolean
預設值false
遮罩反轉切換;true 會反轉遮罩。
image_prompt_1選填
類型object
image_prompt_1.type選填
類型enum
預設值ImagePrompt
ImagePromptPyraCannyCPDSFaceSwap
image_prompt_1.image_url選填
類型url · image
image_prompt_1.stop_at選填
類型number
預設值0.5
0 – 1
image_prompt_1.weight選填
類型number
預設值1
0 – 2
image_prompt_2選填
類型object
image_prompt_2.type選填
類型enum
預設值ImagePrompt
ImagePromptPyraCannyCPDSFaceSwap
image_prompt_2.image_url選填
類型url · image
image_prompt_2.stop_at選填
類型number
預設值0.5
0 – 1
image_prompt_2.weight選填
類型number
預設值1
0 – 2
image_prompt_3選填
類型object
image_prompt_3.type選填
類型enum
預設值ImagePrompt
ImagePromptPyraCannyCPDSFaceSwap
image_prompt_3.image_url選填
類型url · image
image_prompt_3.stop_at選填
類型number
預設值0.5
0 – 1
image_prompt_3.weight選填
類型number
預設值1
0 – 2
image_prompt_4選填
類型object
image_prompt_4.type選填
類型enum
預設值ImagePrompt
ImagePromptPyraCannyCPDSFaceSwap
image_prompt_4.image_url選填
類型url · image
image_prompt_4.stop_at選填
類型number
預設值0.5
0 – 1
image_prompt_4.weight選填
類型number
預設值1
0 – 2
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/inpaint",
  "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": 55,
    "usd": "0.055",
    "charged": 55,
    "refunded": 0
  },
  "input": {
    "inpaint_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "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/inpaint.md. 所有模型與指南: https://doitong.com/developers/llms.txt