FLUX.2 Dev
다중 참조 일관성과 전문 텍스트 렌더링으로 사실적인 이미지를 생성합니다.
워크플로 내부
소스 템플릿의 읽기 전용 미리보기입니다. Cloud에서 열어 노드를 살펴보고 변경할 수 있습니다.
코드에서 이 모델 호출하기
아래 요청은 Playground와 동일하게 준비된 그래프와 설정을 사용합니다. 제출할 때마다 유료 실행이 시작될 수 있으므로 결과를 알 수 없는 제출을 자동으로 재시도하지 마세요.
What you need
- Runs on
- Comfy Cloud
- 키
- COMFY_API_KEY
- 내 파일
- 코드가 해당 URL에서 업로드
유료 Cloud 요금제와 크레딧이 필요합니다.
# 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({
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Flux2",
"images": [
"68:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"45": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"46",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"46": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"68:10": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"68:12": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux2_dev_fp8mixed.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"68:13": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"68:22",
0
],
"latent_image": [
"68:47",
0
],
"noise": [
"68:25",
0
],
"sampler": [
"68:16",
0
],
"sigmas": [
"68:48",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"68:16": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"68:22": {
"class_type": "BasicGuider",
"inputs": {
"conditioning": [
"68:43",
0
],
"model": [
"68:92",
0
]
},
"_meta": {
"title": "Basic Guider"
}
},
"68:25": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 649422536169327
},
"_meta": {
"title": "RandomNoise"
}
},
"68:26": {
"class_type": "FluxGuidance",
"inputs": {
"conditioning": [
"68:6",
0
],
"guidance": 4
},
"_meta": {
"title": "FluxGuidance"
}
},
"68:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "mistral_3_small_flux2_bf16.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP"
}
},
"68:43": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"68:26",
0
],
"latent": [
"68:44",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"68:44": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"45",
0
],
"vae": [
"68:10",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"68:47": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"68:72",
1
],
"width": [
"68:72",
0
]
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"68:48": {
"class_type": "Flux2Scheduler",
"inputs": {
"height": [
"68:72",
1
],
"steps": [
"68:93",
0
],
"width": [
"68:72",
0
]
},
"_meta": {
"title": "Flux2Scheduler"
}
},
"68:6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"68:38",
0
],
"text": "Turn this studio car portrait into a snowy winter night on a quiet city street. Keep the woman exactly as she is: her face, slicked-back dark hair, black cat-eye sunglasses, expression and the arm resting on the window sill. Keep the olive-gold vintage coupe, its chrome door handle, side mirror and the white leather handbag unchanged. Dress her in a camel wool coat with a thick cream knit scarf over her black top. Replace the plain studio backdrop with a softly blurred street of warm glowing shop windows and gently falling snowflakes. Add a thin layer of fresh snow on the car roof and window sill, cool blue ambient light and warm amber reflections across the metallic paint. Photorealistic, same camera angle and composition."
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"68:72": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"45",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"68:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"68:13",
0
],
"vae": [
"68:10",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"68:89": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Flux_2-Turbo-LoRA_comfyui.safetensors",
"model": [
"68:12",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"68:90": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 8
},
"_meta": {
"title": "Steps"
}
},
"68:91": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 20
},
"_meta": {
"title": "Steps"
}
},
"68:92": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"68:12",
0
],
"on_true": [
"68:89",
0
],
"switch": [
"68:94",
0
]
},
"_meta": {
"title": "Switch(model)"
}
},
"68:93": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"68:91",
0
],
"on_true": [
"68:90",
0
],
"switch": [
"68:94",
0
]
},
"_meta": {
"title": "Switch(steps)"
}
},
"68:94": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": False
},
"_meta": {
"title": "Enable 8 steps lora"
}
}
})
workflow.set_input("46", "image", client.assets.from_url("https://comfy.org/catalog-media/7fdd890a-cbb8-4d98-b2cb-35f01890994d/f593ebe0-8ecc-4d03-bb09-673f2b92ef5f"))
# 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("9"):
output.to_file(output.name)예시 사용해 보기
이 워크플로 정보
FLUX.2 Dev 워크플로는 다중 참조 일관성과 전문적인 텍스트 렌더링에 중점을 두고 포토리얼 이미지를 생성하도록 설계되었습니다. 이 워크플로는 여러 참조 지점을 통합해 이미지의 다양한 요소 간 일관성을 보장함으로써 고품질 이미지를 생성하는 능력으로 알려진 FLUX.2 Dev 모델을 활용합니다. 이 워크플로에서 양자화 가중치를 사용하면 출력 품질을 유지하면서도 효율적으로 처리할 수 있습니다. SaveImage, ImageScaleToTotalPixels, LoadImage 같은 주요 노드를 사용해 이미지 입력 및 출력을 효과적으로 관리하며, MarkdownNote 노드는 워크플로 내부에서 문서와 가이드를 제공합니다. 이 설정은 정교한 텍스트 통합과 여러 시각 요소 간 일관성이 필요한 이미지를 만들어야 하는 사용자에게 특히 유용합니다.
질문과 답변
양자화 가중치는 계산 부담을 줄여 모델을 더 효율적으로 실행하면서도 높은 이미지 품질을 유지할 수 있게 해줍니다.
다중 참조 일관성은 이미지 전반의 요소가 올바르게 정렬되도록 하여, 더 응집력 있고 현실적인 최종 출력을 제공합니다.
네, 이 워크플로는 전문적인 텍스트 렌더링을 처리하도록 설계되어 텍스트 통합이 많은 이미지에 적합합니다.
네, ImageScaleToTotalPixels 노드를 사용해 필요에 맞게 이미지 해상도를 조정할 수 있습니다.