Fooocus Upscale or Vary
整合
模型 id
fooocus/upscale-or-vary
# 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/upscale-or-vary?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"uov_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"
const API = "https://api.doitong.ru/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/fooocus/upscale-or-vary?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"uov_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.ru/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"uov_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/fooocus/upscale-or-vary", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/zh-TW/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.ru/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "fooocus/upscale-or-vary",
"input": {
"uov_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
}
透過 Doitong API 呼叫 Fooocus Upscale or Vary 模型(fooocus/upscale-or-vary)。代理程式文件:https://doitong.com/zh-TW/developers/models/fooocus/upscale-or-vary.md
POST https://api.doitong.ru/v1/run/fooocus/upscale-or-vary?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"uov_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
如果回應狀態為 "queued" 或 "running",請輪詢 GET https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20,直到狀態變為 "succeeded";檔案位於 outputs[].url。使用相同主體傳送 POST https://api.doitong.ru/v1/quote/fooocus/upscale-or-vary,可在執行前取得確切價格。
此請求: ≈$0.007 7 API 點數 · ≈ ₽0.75 在此頁面執行
您的新 API 金鑰。 僅會在此時顯示,且已填入下方的程式碼與 API 金鑰欄位。請妥善保密:切勿將其放入在瀏覽器中執行的程式碼。
建立請求
控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。
POST
/run/fooocus/upscale-or-vary?wait=20
報價 → $0.007
# 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/upscale-or-vary?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"uov_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"
const API = "https://api.doitong.ru/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/fooocus/upscale-or-vary?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"uov_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.ru/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"uov_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/fooocus/upscale-or-vary", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "fooocus/upscale-or-vary",
"input": {
"uov_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
},
"wait_seconds": 20
}
}
}
關於 Fooocus Upscale or Vary
接受作為 `uov_image_url` 的來源圖像,並套用 `uov_method`:Vary (Subtle)、Vary (Strong)、Upscale (1.5x)、Upscale (2x) 或 Upscale (Fast 2x)。預設值為 Vary (Strong)。`prompt`、風格、LoRA 與可選的圖像提示詞可引導結果,並會傳回 1 到 4 張圖像。
參數
請傳送標準名稱或原生名稱其中之一,不要同時傳送兩者。 標準名稱
名稱類型
預設值允許值
說明
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 中重現圖像的種子。只要模型版本、提示詞和種子保持不變,每次執行都能精確重現圖像。
uov_image_url必填
類型url · image
用於放大或變化的來源圖像。
uov_method選填
類型enum
預設值Vary (Strong)
DisabledVary (Subtle)Vary (Strong)Upscale (1.5x)Upscale (2x)Upscale (Fast 2x)
用於放大或建立變化的方式。
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_vary_upscale選填
類型boolean
預設值false
將 Image Prompt 與 Vary/Upscale 結合。
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/upscale-or-vary",
"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": 7,
"usd": "0.007",
"charged": 7,
"refunded": 0
},
"input": {
"uov_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 概念。
其他 Fooocus 變體
更多模型:升級解析度
給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/fooocus/upscale-or-vary.md. 所有模型與指南: https://doitong.com/developers/llms.txt