오래된 사진 복원
이 앱은 오래된 사진을 향상시켜줍니다. 이미지를 업로드하면 색 바램이나 손상된 사진을 몇 초 만에 복구할 수 있습니다.
워크플로 내부
소스 템플릿의 읽기 전용 미리보기입니다. 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({
"76": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"156": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "photo_restoration",
"images": [
"158:154",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"157": {
"class_type": "ImageCompare",
"inputs": {
"compare_view": {
"__value__": [
"",
""
]
},
"image_a": [
"156",
0
],
"image_b": [
"76",
0
]
},
"_meta": {
"title": "Compare Images"
}
},
"185": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Restore this old photograph. Remove all scratches, dust, creases, tears, and stains. Repair faded and damaged areas. Enhance sharpness and fine detail while preserving the original faces, expressions, clothing, and background exactly as they are. Do not change the identity of any person, the composition, or add or remove any objects. High-quality photo restoration."
},
"_meta": {
"title": "Restore Prompt"
}
},
"186": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Restore this old photograph of four travelers standing on a rocky shoreline. Remove every crease, fold line, tear, water stain, mildew spot, scratch and speck of dust, and rebuild the missing torn corner so the rocks, grass and sky continue naturally. Repair the faded areas and recover detail in the knitted sweaters, oilcloth coats, boots and the faces. Keep every person's identity, expression, pose and position exactly as they are, and keep the shoreline, the sea spray and the composition unchanged. Colorize it with realistic, period-appropriate colors: weathered skin tones, undyed cream and charcoal wool, dark olive oilcloth, wet slate rocks, grey-green sea grass and a pale overcast sky over grey-blue water. The result should look like a well-preserved color photograph from the era, not a modern image."
},
"_meta": {
"title": "Restore + Colorize Prompt"
}
},
"187": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"185",
0
],
"on_true": [
"186",
0
],
"switch": True
},
"_meta": {
"title": "Enhanced Color Restoration"
}
},
"188": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"187",
0
]
},
"_meta": {
"title": "Final Prompt Preview"
}
},
"158:133": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"158:145",
0
],
"sampling": "flow",
"shift": 3.1
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"158:134": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"158:135": {
"class_type": "FluxKontextMultiReferenceLatentMethod",
"inputs": {
"conditioning": [
"158:137",
0
],
"reference_latents_method": "index_timestep_zero"
},
"_meta": {
"title": "Edit Model Reference Method"
}
},
"158:136": {
"class_type": "FluxKontextMultiReferenceLatentMethod",
"inputs": {
"conditioning": [
"158:139",
0
],
"reference_latents_method": "index_timestep_zero"
},
"_meta": {
"title": "Edit Model Reference Method"
}
},
"158:137": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"158:146",
0
],
"image1": [
"158:155",
0
],
"prompt": "",
"vae": [
"158:134",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"158:139": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"158:146",
0
],
"image1": [
"158:155",
0
],
"prompt": [
"188",
0
],
"vae": [
"158:134",
0
]
},
"_meta": {
"title": "TextEncodeQwenImageEditPlus (Positive)"
}
},
"158:140": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"158:133",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"158:141": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors",
"model": [
"158:140",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"158:142": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 4
},
"_meta": {
"title": "CFG"
}
},
"158:143": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1
},
"_meta": {
"title": "CFG"
}
},
"158:144": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"158:155",
0
],
"vae": [
"158:134",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"158:145": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2511_fp8mixed.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"158:146": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"158:147": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"158:140",
0
],
"on_true": [
"158:141",
0
],
"switch": [
"158:150",
0
]
},
"_meta": {
"title": "Switch (Model)"
}
},
"158:148": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 4
},
"_meta": {
"title": "Steps"
}
},
"158:149": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 40
},
"_meta": {
"title": "Steps"
}
},
"158:150": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Enable 4steps LoRA?"
}
},
"158:151": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"158:142",
0
],
"on_true": [
"158:143",
0
],
"switch": [
"158:150",
0
]
},
"_meta": {
"title": "Switch (CFG)"
}
},
"158:152": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"158:149",
0
],
"on_true": [
"158:148",
0
],
"switch": [
"158:150",
0
]
},
"_meta": {
"title": "Switch (Steps)"
}
},
"158:153": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"158:151",
0
],
"denoise": 1,
"latent_image": [
"158:144",
0
],
"model": [
"158:147",
0
],
"negative": [
"158:135",
0
],
"positive": [
"158:136",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 179526350171703,
"steps": [
"158:152",
0
]
},
"_meta": {
"title": "KSampler"
}
},
"158:154": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"158:153",
0
],
"vae": [
"158:134",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"158:155": {
"class_type": "FluxKontextImageScale",
"inputs": {
"image": [
"76",
0
]
},
"_meta": {
"title": "FluxKontextImageScale"
}
}
})
workflow.set_input("76", "image", client.assets.from_url("https://comfy.org/catalog-media/36b7be97-9ae9-45b4-a1b5-755305cdca6a/35f22ae6-ca98-43bb-86cf-a4734fc1b43a"))
# 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("156"):
output.to_file(output.name)예시 사용해 보기
이 워크플로 정보
오래된 사진 복원은 색 바램, 스크래치, 저대비 이미지를 추측 없이 복원하는 데 집중한 ComfyUI 워크플로입니다. 필수 유틸리티 노드와 전용 복원 단계를 결합해, 미리보기/비교/내보내기를 확신 있게 진행할 수 있습니다. 흐름은 LoadImage에서 시작해 커스텀 복원 연산자(노드 ID 4c000cf8-4ec4-49a6-853c-e78dd316edc6)를 거치며, ComfySwitchNode로 비파괴 제어를 제공해 손대지 않은 입력(원본)과 복원 결과를 즉시 전환할 수 있습니다.
기술적으로 원본 및 처리된 이미지는 ImageCompare로 라우팅되어 나란히 평가할 수 있고, PreviewAny로 반복 작업 중 캔버스에서 빠르게 확인할 수 있습니다. PrimitiveStringMultiline은 그래프 내에 여러 줄 메모(예: 세션 설정 또는 변경 로그)를 직접 유지하는 용도로 포함되어 있으며, SaveImage가 최종 선택을 디스크에 저장합니다. 이 레이아웃은 A/B 검증과 반복 가능성을 강조합니다. 커스텀 노드가 노출하는 설정으로 복원을 조정하고, 스위치로 영향도를 판단하고, ImageCompare로 검증한 뒤, 결과가 기준을 만족할 때만 내보내기하세요.
질문과 답변
이 워크플로에서 전용 복원 단계입니다. 구현 및 노출 파라미터에 따라 보통 디노이징, 대비 및 색상 복원, 아티팩트 감소 같은 작업을 수행합니다. 설치된 환경에서 어떤 컨트롤을 제공하는지 확인하려면 노드를 열어보세요.
속도와 부드러운 반복 작업을 위해 GPU를 권장합니다. 일부 환경에서는 CPU로도 실행할 수 있지만 처리 속도가 크게 느려집니다. 미리보기가 느리다면 테스트 중에는 이미지 해상도를 낮추고, 최종 결과에서 다시 원래 크기로 올리세요.
가능합니다. ComfySwitchNode를 복원 분기로 설정하고 SaveImage를 활성화한 상태로 한 번 실행해 저장한 뒤, 스위치를 원본 분기로 전환하고 다시 실행해 그 버전도 저장하면 됩니다. ImageCompare는 평가용이고, 실제 파일 내보내기는 SaveImage가 담당합니다.
아니오. 입력의 기본 해상도에서 복원에 집중합니다. 업스케일링이 필요하면 복원 단계 뒤에 업스케일러 노드를 추가한 별도 워크플로 또는 이 그래프의 수정 버전을 사용하세요.