Flux.1 Depth Lora
Generate images guided by depth information using Flux.1 LoRA.
Download WorkflowTry in Cloud API documentation
About
Generate images guided by depth information using Flux.1 LoRA.
What you provide
- Reading the workflow
Runs in ComfyUI. This workflow can't run on this page. Open it in Comfy Cloud with everything loaded, or download it for your own ComfyUI.
Try in CloudExample
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 preview- Author
- ComfyUI
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({
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"35",
2
],
"model": [
"37",
0
],
"negative": [
"35",
1
],
"positive": [
"35",
0
],
"sampler_name": "euler",
"scheduler": "normal",
"seed": 229472716717627,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"34",
0
],
"text": ""
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"32",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"17": {
"class_type": "LoadImage",
"inputs": {
"image": "flux_depth_lora_example_input_image.png"
},
"_meta": {
"title": "Load Image"
}
},
"23": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"34",
0
],
"text": "A cute ghost-shaped desktop ornament, softly glowing with a warm light, placed on a tidy, cozy home table, creating a gentle and sweet atmosphere."
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"26": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"23",
0
],
"guidance": 10
},
"_meta": {
"title": "FluxGuidance"
}
},
"31": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux1-dev-fp8.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"32": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"34": {
"class_type": "DualCLIPLoader",
"inputs": {
"clip_name1": "clip_l.safetensors",
"clip_name2": "t5xxl_fp16.safetensors",
"device": "default",
"type": "flux"
},
"_meta": {
"title": "Load CLIP (Dual)"
}
},
"35": {
"class_type": "InstructPixToPixConditioning",
"inputs": {
"negative": [
"7",
0
],
"pixels": [
"41:99",
0
],
"positive": [
"26",
0
],
"vae": [
"32",
0
]
},
"_meta": {
"title": "InstructPixToPixConditioning"
}
},
"37": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "flux1-depth-dev-lora.safetensors",
"model": [
"31",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"43": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"41:99",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"41:100": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"41:101": {
"class_type": "SetFirstSigma",
"inputs": {
"sigma": 10000,
"sigmas": [
"41:95",
0
]
},
"_meta": {
"title": "SetFirstSigma"
}
},
"41:87": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "lotus-depth-d-v1-1.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"41:89": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "vae-ft-mse-840000-ema-pruned.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"41:92": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"41:94",
0
],
"latent_image": [
"41:97",
0
],
"noise": [
"41:93",
0
],
"sampler": [
"41:100",
0
],
"sigmas": [
"41:101",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"41:93": {
"class_type": "DisableNoise",
"inputs": {},
"_meta": {
"title": "DisableNoise"
}
},
"41:94": {
"class_type": "BasicGuider",
"inputs": {
"conditioning": [
"41:96",
0
],
"model": [
"41:87",
0
]
},
"_meta": {
"title": "Basic Guider"
}
},
"41:95": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"41:87",
0
],
"scheduler": "normal",
"steps": 1
},
"_meta": {
"title": "BasicScheduler"
}
},
"41:96": {
"class_type": "LotusConditioning",
"inputs": {},
"_meta": {
"title": "LotusConditioning"
}
},
"41:97": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"17",
0
],
"vae": [
"41:89",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"41:98": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"41:92",
0
],
"vae": [
"41:89",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"41:99": {
"class_type": "ImageInvert",
"inputs": {
"image": [
"41:98",
0
]
},
"_meta": {
"title": "Invert Image Colors"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)