FLUX.2 Klein KV: Image Edit
Upload reference images and a text prompt. Generate multiple edited images using cached image data for faster processing.
Download WorkflowTry in Cloud API documentation
About
Upload reference images and a text prompt. Generate multiple edited images using cached image data for faster processing.
What you provide
- Reading the workflow
Runs in ComfyUI. This workflow can only run on your own ComfyUI. Download it and drop the file onto the canvas.
Download WorkflowNo sample outputs for this workflow yet.
Inside the workflow
A read-only preview of the node graph. Open it in Comfy Cloud or download it to edit the nodes.
Loading the graph
Open full-size workflow previewFiles in this workflow
- Comfy Cloud
- No
- Output
- Image
- Author
- Author unavailable
Requires custom nodes
- Reading the workflow
Use this workflow from code
Generated from the workflow graph and inputs when possible; stored examples are shown otherwise. Review credentials and endpoints before running code, which may incur charges.
1 Get API key ↗
What you need
- Runs on
- Comfy Cloud
- Key
- COMFY_API_KEY
Needs a paid Cloud plan and credits.
Download API JSONAPI documentation ↗
# 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)Related workflows
- UUltraTex, FLUX.2 Klein
UltraTex: Texture a 3D Model
- ZZ-Image-Turbo
1.1 Starter - Text to Image
- Nano Banana 2 Text-to-Image
3x3 Contact Sheet
- AAnima
Anima Anime Text-to-Image Generation
- AAnima
Anima Base v1: Text to Image
- 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
- ZZ-Image-Turbo
Batch Process Text Prompts From List
- BBoogu
Boogu Turbo: Text to Image
- BRIA
Bria: FIBO 2.0 Text to Image