헤어스타일 체인저
결정하기 전에 어떤 헤어컷이나 헤어 색상도 미리 확인해 보세요. 셀피를 업로드하고 헤어스타일 변경 워크플로를 사용해 다양한 헤어 옵션을 적용해 보세요.
정보
Hairstyle Changer는 셀피에서 다양한 헤어컷과 헤어 색상을 실제로 적용하기 전에 미리보기할 수 있는 ComfyUI 워크플로입니다. LoadImage로 사진을 불러온 뒤, ComfySwitchNode와 PrimitiveStringMultiline에 정의된 프리셋 문자열을 통해 스타일 선택을 라우팅합니다. 선택값은 StringConcatenate로 결합되며, 필요 시 JsonExtractString으로 구조화된 프리셋 블록에서 가져옵니다. 편집 결과는 PreviewAny에서 표시되고 SaveImage로 저장됩니다.
핵심에는 업스트림에서 준비된 입력을 사용해 헤어스타일/색상 변경을 적용하는 커스텀 처리 노드(id: d4c06663-cb1a-4a41-a36b-f09c93e55e7e)가 있습니다. CustomCombo는 이미지 및 텍스트 파라미터를 해당 노드에 깔끔한 입력으로 패키징하는 데 사용됩니다. 이 파라미터화된 설계 덕분에 ComfySwitchNode를 전환하거나 프리셋 문자열을 조금 조정하는 것만으로도 룩을 쉽게 A/B 테스트할 수 있으며, 원본 사진은 그대로 유지한 채 머리 표현에만 변경을 집중할 수 있습니다.
제공할 항목
- 워크플로 읽는 중
ComfyUI에서 실행됩니다. 이 워크플로는 이 페이지에서 실행할 수 없습니다. 모든 항목이 로드된 Comfy Cloud에서 열거나, 자체 ComfyUI에서 사용하려면 다운로드하세요.
Cloud에서 사용해 보기워크플로 내부
노드 그래프의 읽기 전용 미리보기입니다. 노드를 편집하려면 Comfy Cloud에서 열거나 다운로드하세요.
Loading the graph
Open full-size workflow preview코드에서 이 워크플로 사용하기
가능한 경우 워크플로 그래프와 입력을 기반으로 생성되며, 그렇지 않은 경우 저장된 예시가 표시됩니다. 비용이 발생할 수 있으므로 코드를 실행하기 전에 자격 증명과 엔드포인트를 검토하세요.
What you need
- Runs on
- Comfy Cloud
- 키
- COMFY_API_KEY
유료 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({
"132": {
"class_type": "LoadImage",
"inputs": {
"image": "e6bc10130ce0e9dbd3573751650d9f01c2687728383958094ab49d0b35ccfeae.png"
},
"_meta": {
"title": "Load Image"
}
},
"197": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Qwen_Edit_2511",
"images": [
"196:175",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"234": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Keep the exact same facial identity, facial features, expression, pose, clothing, background, lighting, and composition as the original photo. Only change the subject's hair.",
"string_b": [
"258",
0
]
},
"_meta": {
"title": "Assemble Prompt"
}
},
"235": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"234",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"252": {
"class_type": "CustomCombo",
"inputs": {
"choice": "Long Waves"
},
"_meta": {
"title": "Hairstyle"
}
},
"253": {
"class_type": "JsonExtractString",
"inputs": {
"json_string": "{\n \"Buzz Cut\": \"Change the subject's hairstyle to a very short, even buzz cut with a clean hairline.\",\n \"Slicked Back\": \"Change the subject's hairstyle to medium-length hair combed straight back with a polished sheen.\",\n \"Side Part\": \"Change the subject's hairstyle to a classic neatly combed side part with a crisp parting line.\",\n \"Textured Quiff\": \"Change the subject's hairstyle to a voluminous textured quiff with short faded sides.\",\n \"Curly Top\": \"Change the subject's hairstyle to tight natural curls on top with tapered short sides.\",\n \"Afro\": \"Change the subject's hairstyle to a full, rounded natural afro with soft, even volume.\",\n \"Long Waves\": \"Change the subject's hairstyle to shoulder-length loose, flowing waves with natural body.\",\n \"Long Straight\": \"Change the subject's hairstyle to long, sleek, straight hair falling past the shoulders.\",\n \"Bob Cut\": \"Change the subject's hairstyle to a chin-length blunt bob with a smooth, even edge.\",\n \"Pixie Cut\": \"Change the subject's hairstyle to a short, cropped pixie cut with soft feathered layers.\",\n \"Box Braids\": \"Change the subject's hairstyle to neat medium-width box braids falling to the shoulders.\",\n \"High Ponytail\": \"Change the subject's hairstyle to hair pulled up into a sleek high ponytail.\",\n \"Top Knot Bun\": \"Change the subject's hairstyle to hair gathered into a neat top-knot bun.\",\n \"Mohawk\": \"Change the subject's hairstyle to a bold upright mohawk with closely shaved sides.\",\n \"Bald\": \"Remove the subject's hair entirely, giving them a cleanly shaved bald head with natural scalp texture.\"\n}",
"key": [
"252",
0
]
},
"_meta": {
"title": "Hairstyle Prompt (JSON)"
}
},
"256": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": [
"253",
0
],
"string_b": [
"263",
0
]
},
"_meta": {
"title": "Hairstyle + Color"
}
},
"257": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Change the subject's hairstyle to shoulder-length loose waves colored copper red. Keep everything else exactly the same."
},
"_meta": {
"title": "Custom Prompt Text"
}
},
"258": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"256",
0
],
"on_true": [
"257",
0
],
"switch": False
},
"_meta": {
"title": "Custom Prompt?"
}
},
"262": {
"class_type": "CustomCombo",
"inputs": {
"choice": "Platinum White"
},
"_meta": {
"title": "Hair Color"
}
},
"263": {
"class_type": "JsonExtractString",
"inputs": {
"json_string": "{\n \"Keep Original Color\": \"Keep the subject's original hair color.\",\n \"Blonde\": \"The hair is colored blonde.\",\n \"Dark Brown\": \"The hair is colored dark brown.\",\n \"Black\": \"The hair is colored black.\",\n \"Auburn Red\": \"The hair is colored auburn red.\",\n \"Platinum White\": \"The hair is colored platinum white.\",\n \"Silver Gray\": \"The hair is colored silver gray.\"\n}",
"key": [
"262",
0
]
},
"_meta": {
"title": "Hair Color Prompt (JSON)"
}
},
"196:152": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"196:155",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"196:155": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"196:166",
0
],
"sampling": "flow",
"shift": 3.1
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"196:156": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"196:161": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"196:167",
0
],
"image1": [
"196:176",
0
],
"prompt": [
"235",
0
],
"vae": [
"196:156",
0
]
},
"_meta": {
"title": "TextEncodeQwenImageEditPlus (Positive)"
}
},
"196:162": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors",
"model": [
"196:152",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"196:163": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 4
},
"_meta": {
"title": "CFG"
}
},
"196:164": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1
},
"_meta": {
"title": "CFG"
}
},
"196:165": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"196:176",
0
],
"vae": [
"196:156",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"196:166": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2511_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"196:167": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"196:168": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"196:152",
0
],
"on_true": [
"196:162",
0
],
"switch": [
"196:171",
0
]
},
"_meta": {
"title": "Switch (Model)"
}
},
"196:169": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 6
},
"_meta": {
"title": "Steps"
}
},
"196:170": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 30
},
"_meta": {
"title": "Steps"
}
},
"196:171": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Enable 4steps LoRA?"
}
},
"196:172": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"196:163",
0
],
"on_true": [
"196:164",
0
],
"switch": [
"196:171",
0
]
},
"_meta": {
"title": "Switch (CFG)"
}
},
"196:173": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"196:170",
0
],
"on_true": [
"196:169",
0
],
"switch": [
"196:171",
0
]
},
"_meta": {
"title": "Switch (Steps)"
}
},
"196:174": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"196:172",
0
],
"denoise": 1,
"latent_image": [
"196:165",
0
],
"model": [
"196:168",
0
],
"negative": [
"196:229",
0
],
"positive": [
"196:161",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 935848232837487,
"steps": [
"196:173",
0
]
},
"_meta": {
"title": "KSampler"
}
},
"196:175": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"196:174",
0
],
"vae": [
"196:156",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"196:176": {
"class_type": "FluxKontextImageScale",
"inputs": {
"image": [
"132",
0
]
},
"_meta": {
"title": "FluxKontextImageScale"
}
},
"196:229": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"196:167",
0
],
"image1": [
"196:176",
0
],
"prompt": "",
"vae": [
"196:156",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)질문과 답변
정면, 고른 조명, 머리카락이 잘 보이는 사진이 좋습니다. 모자, 큰 액세서리, 가려진 머리는 피하세요. 배경이 단순할수록 헤어 인식이 잘 됩니다.
커스텀 프로세서(노드 id d4c06663-cb1a-4a41-a36b-f09c93e55e7e)와 텍스트 파라미터로 머리카락에 집중해 변환합니다. 주변 영역에 약간 번짐이 있을 수 있으니, 이런 경우 머리 부분만 잘라서 사용하거나 프리셋 변화를 줄이고 재실행해보세요.
PrimitiveStringMultiline에 새로운 프리셋 항목(예: "copper_lob", "icy_blonde" 등)을 추가하세요. JsonExtractString으로 해당 항목을 불러오고, ComfySwitchNode가 올바른 키를 가리키는지 확인하세요. StringConcatenate가 최종 파라미터 문자열을 조합합니다.
d4c06663-cb1a-4a41-a36b-f09c93e55e7e 커스텀 노드를 제공하는 확장 기능을 설치하고 ComfyUI를 재시작하세요. ComfyUI 콘솔/로그에서 설치해야 할 저장소나 패키지명을 확인할 수 있습니다.
관련 워크플로
- Nano Banana Pro, Gemini3 Pro Image Preview, Google
Create a character turnaround
- Qwen-Image-Edit
Change a material
- Qwen-Image-Edit
See your subject from a new angle
- Flux.2 Dev, Flux
Create a product mockup
- Nano Banana Pro
Try an outfit on a character
- Seedream
Put your product in a new scene
- SSeedVR2
Upscale and restore detail
- Nano Banana Pro
Sharpen a product photo
- Topaz
Upscale an illustration
- HHitPaw
Restore portrait detail
- FLUX.1 Fill
Edit a selected region
- FLUX.1 Fill
Extend an image’s borders