Flux.1 Lora de Profundidade
Gere imagens guiadas por informações de profundidade usando Flux LoRA.
Baixar workflowExperimentar no Cloud Documentação da API
Sobre
Gere imagens guiadas por informações de profundidade usando Flux LoRA.
O que você fornece
- Lendo o fluxo de trabalho
É executado no ComfyUI. Este fluxo de trabalho não pode ser executado nesta página. Abra-o no Comfy Cloud com tudo carregado ou baixe-o para usar no seu próprio ComfyUI.
Experimentar no CloudExemplo
Dentro do workflow
Uma prévia somente leitura do gráfico de nós. Abra-o no Comfy Cloud ou faça o download para editar os nós.
Loading the graph
Open full-size workflow previewArquivos neste workflow
- Autor
- ComfyUI
Requer nós personalizados
- Lendo o fluxo de trabalho
Use este fluxo de trabalho a partir do código
Gerado a partir do grafo e das entradas do fluxo de trabalho quando possível; caso contrário, são exibidos exemplos armazenados. Revise as credenciais e os endpoints antes de executar o código, pois isso pode gerar cobranças.
1 Obter chave de API ↗
What you need
- Runs on
- Comfy Cloud
- Chave
- COMFY_API_KEY
Requer um plano pago do Cloud e créditos.
Baixar JSON da APIDocumentação da API ↗
# 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)