FLUX.2 Pro
產生照片級寫實圖像,支援多參考一致性與專業文字渲染。
下載工作流程在 Cloud 中試用 API 文件
工作流程內部
來源範本的唯讀預覽。請在 Cloud 中開啟,以探索節點並進行變更。
Loading the graph
Open full-size workflow preview- 輸出
- 圖片
- 作者
- ComfyUI
從您的程式碼呼叫此模型
以下請求使用與 Playground 相同的已準備節點圖和設定。每次提交都可能啟動付費執行;若提交結果不明,請勿自動重試提交。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
- 您的檔案
- 由程式碼透過其 URL 上傳
需要付費 Cloud 方案與點數。
下載 API JSONAPI 文件 ↗
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"11": {
"class_type": "Flux2ProImageNode",
"inputs": {
"height": 1088,
"images": [
"22",
0
],
"prompt": "A photoshoot-style group portrait of exactly four people, one from each of the four reference images, all four fully visible from head to shoes: the person in the cobalt-blue velvet suit with flared trousers, the man in the moss-green brocade tunic and wide grey trousers, the older man in the blue double-breasted suit with a yellow scarf, and the woman in the sculpted cream jacket and layered skirt. Keep each face, hair, skin tone, build and outfit exactly as in their reference. Shot from high above on a tall platform, looking down at a steep angle, the four stand evenly spaced in a loose row on a pale concrete rooftop at golden hour and look up toward the lens. Long clean shadows stretch across the roof, a hazy city far below. Crisp editorial magazine look, no text or logos.",
"prompt_upsampling": True,
"seed": 96048955606126,
"width": 1920
},
"_meta": {
"title": "Flux.2 [pro] Image"
}
},
"12": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Flux.2[pro]",
"images": [
"11",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"15": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_1_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"16": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_3_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"18": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_4_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"19": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_2_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"22": {
"class_type": "BatchImagesNode",
"inputs": {
"images.image0": [
"15",
0
],
"images.image1": [
"19",
0
],
"images.image2": [
"16",
0
],
"images.image3": [
"18",
0
]
},
"_meta": {
"title": "Batch Images"
}
}
})
workflow.set_input("15", "image", client.assets.from_url("https://comfy.org/catalog-media/1a3f777f-b1c4-40af-a67a-0fba141e99f2/6a589022-bb3e-4d88-a8bf-7a4fb0cd6dac"))
workflow.set_input("19", "image", client.assets.from_url("https://comfy.org/catalog-media/ed79d568-928a-4f40-8f29-5fe6adb98cef/d9993afb-7bfe-4afe-8242-a39c19decf09"))
workflow.set_input("16", "image", client.assets.from_url("https://comfy.org/catalog-media/888155e0-e8a3-4bfb-b32b-1279d85ef1cb/4e128683-0078-4c59-abc3-70964364f268"))
workflow.set_input("18", "image", client.assets.from_url("https://comfy.org/catalog-media/256dde63-7af3-412f-b438-b3f8ab287c06/70643f22-81e1-49f3-9d24-d3062cfd3e77"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("12"):
output.to_file(output.name)試試範例
關於此工作流程
FLUX.2 Pro 工作流程專為生成高解析度實拍級圖像設計,重點在於多參考一致性與專業文字渲染。透過 FLUX.2 模型,本流程可產生最高 4MP 的圖像,確保每個細節都精準呈現。流程包含 Flux2ProImageNode(核心圖像生成)、SaveImage(儲存輸出)、LoadImage 與 BatchImagesNode(多圖參考輸入),確保生成圖像在不同視覺元素間保持一致。
技術上,本流程可整合多張輸入圖像,讓不同風格與元素自然融合,特別適合需要多圖一致性的專案,如品牌識別或廣告活動。專業文字渲染功能進一步提升應用彈性,非常適合需要精確文字整合的圖像,如海報或數位廣告。
問答
FLUX.2 Pro 支援最高 4MP 圖像生成,細節與清晰度兼具。
可以,透過 LoadImage 與 BatchImagesNode 可輸入多張參考圖,確保生成圖像的一致性。
本流程具備專業文字渲染功能,可將精確、清晰的文字整合進圖像中。
非常適合,高解析度與一致性特性讓它適用於行銷、品牌等商業應用。