FLUX.2 Klein KV: Image Edit
Upload reference images and a text prompt. Generate multiple edited images using cached image data for faster processing.
下載工作流程在 Cloud 中試用 API 文件
關於
Upload reference images and a text prompt. Generate multiple edited images using cached image data for faster processing.
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程只能在您自己的 ComfyUI 中執行。請下載後將檔案拖放到畫布上。
下載工作流程此工作流程尚無範例輸出。
工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
Loading the graph
Open full-size workflow preview此工作流程中的檔案
- Comfy Cloud
- 否
- 輸出
- 圖片
- 作者
- 作者無法使用
需要自訂節點
- 正在讀取工作流程
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 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({
"76": {
"class_type": "LoadImage",
"inputs": {
"image": "man_in_street.png"
},
"_meta": {
"title": "Load Image"
}
},
"81": {
"class_type": "LoadImage",
"inputs": {
"image": "safari_outfit.png"
},
"_meta": {
"title": "Load Image"
}
},
"94": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Flux2_Klein_9b_kv",
"images": [
"124",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"122": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"123": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"138",
0
],
"latent_image": [
"129",
0
],
"noise": [
"125",
0
],
"sampler": [
"122",
0
],
"sigmas": [
"137",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"124": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"123",
0
],
"vae": [
"127",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"125": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 720512742793301
},
"_meta": {
"title": "RandomNoise"
}
},
"126": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux-2-klein-9b-kv-fp8.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"127": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"128": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"130",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"129": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"128",
1
],
"width": [
"128",
0
]
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"130": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"76",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"131": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"81",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"133": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_3_8b_fp8mixed.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP"
}
},
"135": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"133",
0
],
"text": "Have the man in Figure 1 put on the clothes from Figure 2, wear a hat, and carry a bag. Then, change the background environment to an African savannah while keeping the man in the same posture to give a natural outdoor feel."
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"137": {
"class_type": "Flux2Scheduler",
"inputs": {
"height": [
"128",
1
],
"steps": 4,
"width": [
"128",
0
]
},
"_meta": {
"title": "Flux2Scheduler"
}
},
"138": {
"class_type": "CFGGuider",
"inputs": {
"cfg": 1,
"model": [
"139",
0
],
"negative": [
"132:119",
0
],
"positive": [
"132:121",
0
]
},
"_meta": {
"title": "CFG Guider"
}
},
"139": {
"class_type": "FluxKVCache",
"inputs": {
"model": [
"126",
0
]
},
"_meta": {
"title": "Flux KV Cache"
}
},
"685": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"135",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"132:119": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"134:116",
0
],
"latent": [
"132:120",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"132:120": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"131",
0
],
"vae": [
"127",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"132:121": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"134:118",
0
],
"latent": [
"132:120",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"134:116": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"685",
0
],
"latent": [
"134:117",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"134:117": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"130",
0
],
"vae": [
"127",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"134:118": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"135",
0
],
"latent": [
"134:117",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)相關工作流程
- UUltraTex, FLUX.2 Klein
UltraTex:3D 模型貼圖
- ZZ-Image-Turbo
1.1 入門-文字轉圖像
- Nano Banana 2 Text-to-Image
3x3 Contact Sheet
- AAnima
Anima Anime 文生圖產生
- AAnima
Anima Base v1:文字轉圖像
- AAnima
Anima Lllite: Any Control to Image
- AAnima
Anima Lllite: Depth Control to Image
- AAnima
Anima Lllite: Image Inpainting
- QQuiver
Arrow 2: Text to SVG
- BBoogu
Boogu Turbo: Text to Image
- BRIA
Bria: FIBO 2.0 Text to Image
- CChroma, Flux
Chroma: 文生圖