FLUX.2 Klein 9B: 이미지 확장
FLUX.2 Klein 9B 모델을 사용하여 이미지 콘텐츠를 지능적으로 확장하고 펼칩니다. 이미지를 입력하여 원활한 아웃페인팅 및 확장된 구성을 생성합니다.
워크플로 내부
소스 템플릿의 읽기 전용 미리보기입니다. Cloud에서 열어 노드를 살펴보고 변경할 수 있습니다.
Loading the graph
Open full-size workflow preview이 워크플로의 파일
- 출력
- 이미지
- 작성자
- ComfyUI
코드에서 이 모델 호출하기
아래 요청은 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({
"133": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"136",
0
],
"latent_image": [
"139",
0
],
"noise": [
"135",
0
],
"sampler": [
"137",
0
],
"sigmas": [
"138",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"134": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_3_8b.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP"
}
},
"135": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 754163315896983
},
"_meta": {
"title": "RandomNoise"
}
},
"136": {
"class_type": "CFGGuider",
"inputs": {
"cfg": 1,
"model": [
"158",
0
],
"negative": [
"149",
0
],
"positive": [
"148",
0
]
},
"_meta": {
"title": "CFG Guider"
}
},
"137": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"138": {
"class_type": "Flux2Scheduler",
"inputs": {
"height": [
"143",
1
],
"steps": 4,
"width": [
"143",
0
]
},
"_meta": {
"title": "Flux2Scheduler"
}
},
"139": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": [
"143",
1
],
"width": [
"143",
0
]
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"140": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"133",
0
],
"vae": [
"161",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"142": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Flux2-Klein",
"images": [
"167",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"143": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"165",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"144": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"157",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"145": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"165",
0
],
"vae": [
"161",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"147": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"159",
0
],
"megapixels": 1.5000000000000002,
"resolution_steps": 1,
"upscale_method": "nearest-exact"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"148": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"157",
0
],
"latent": [
"145",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"149": {
"class_type": "ReferenceLatent",
"inputs": {
"conditioning": [
"144",
0
],
"latent": [
"145",
0
]
},
"_meta": {
"title": "Set Reference Latent"
}
},
"157": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"134",
0
],
"text": "Remove the green areas by extending the scene into them seamlessly. Continue the flooded Victorian conservatory on both sides: more cast-iron columns with weathered verdigris, hanging ferns and curtains of moss, tiered glass terrariums, pale water lilies and drifting paper folios on the still water, and golden shafts of light falling through the broken glass roof. Match the perspective, the warm morning light, the soft haze and the celadon, bronze and parchment palette of the original exactly. Keep the seated naturalist and everything already in the picture unchanged, with no visible seam, border or repeated pattern."
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"158": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "flux-2-klein-9b.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"159": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"161": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"164": {
"class_type": "ImagePadForOutpaint",
"inputs": {
"bottom": 0,
"feathering": 40,
"image": [
"147",
0
],
"left": 480,
"right": 480,
"top": 0
},
"_meta": {
"title": "Pad Image for Outpainting"
}
},
"165": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"166",
0
],
"megapixels": 1.0000000000000002,
"resolution_steps": 1,
"upscale_method": "nearest-exact"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"166": {
"class_type": "DrawMaskOnImage",
"inputs": {
"color": "0, 255, 0",
"device": "cpu",
"image": [
"164",
0
],
"mask": [
"164",
1
]
},
"_meta": {
"title": "Draw Mask On Image"
}
},
"167": {
"class_type": "ColorMatch",
"inputs": {
"image_ref": [
"159",
0
],
"image_target": [
"140",
0
],
"method": "mkl",
"multithread": True,
"strength": 1
},
"_meta": {
"title": "Color Match"
}
},
"303": {
"class_type": "ImageCompare",
"inputs": {
"compare_view": {
"__value__": [
"",
""
]
},
"image_a": [
"165",
0
],
"image_b": [
"167",
0
]
},
"_meta": {
"title": "Compare Images"
}
}
})
workflow.set_input("159", "image", client.assets.from_url("https://comfy.org/catalog-media/6dadb3e5-93c6-4512-9aac-01481e9a3c7d/4c74a3e3-fb61-488f-a711-8173c8310920"))
# 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("142"):
output.to_file(output.name)예시 사용해 보기
이 워크플로 정보
'FLUX.2 Klein 9B: Image Extend' 워크플로는 FLUX.2 Klein 9B 모델을 사용해 이미지를 확장하고 보강하도록 설계되었습니다. 이 워크플로는 아웃페인팅에 강하며, 원본 스타일과 콘텐츠를 유지하면서 이미지 경계를 바깥으로 확장하는 기법을 제공합니다. SamplerCustomAdvanced, CLIPLoader, RandomNoise 같은 고급 노드를 조합해 입력 이미지의 확장을 자연스럽게 생성합니다. ComfyUI-Color-Matcher와 comfyui-kjnodes를 함께 사용해 색상 일관성과 스타일의 응집을 유지하므로, 제한된 소스에서 더 넓은 구도를 만들어야 하는 아티스트와 디자이너에게 유용합니다.
기술적으로 워크플로는 이미지를 로드한 뒤 VAEEncode 노드로 잠재 공간에 인코딩하는 것으로 시작합니다. 이후 ImagePadForOutpaint 노드로 새 콘텐츠를 위한 공간을 만들기 위해 이미지를 패딩합니다. Flux2Scheduler 및 UNETLoader 노드가 함께 새 이미지 데이터를 생성하며, 기존 콘텐츠와 자연스럽게 블렌딩되도록 합니다. 과정은 CFGGuider 및 KSamplerSelect 노드가 입력 프롬프트와 조건에 따라 생성 과정을 정교하게 가이드합니다. 아웃페인팅이 완료되면 VAEDecode 노드가 잠재 표현을 다시 가시 이미지 포맷으로 변환해 저장 또는 추가 편집이 가능하도록 합니다.
질문과 답변
아웃페인팅은 기존 이미지의 경계를 확장해, 원본과 자연스럽게 어우러지는 새로운 콘텐츠를 생성하는 기법입니다.
네, 모든 이미지에 사용할 수 있지만, 이미지의 복잡도와 프롬프트에 따라 결과가 달라질 수 있습니다.
ComfyUI-Color-Matcher 노드를 사용해 확장 영역의 색상이 원본과 일치하도록 보정합니다.
'지평선을 확장', '초록색 부분을 제거' 등 원하는 변화나 확장 내용을 명확히 설명하는 프롬프트가 가장 좋은 결과를 냅니다.
관련 워크플로
- Flux.2 Klein
1.3 스타터 – 제품 사진 촬영
- Flux.2 Dev, Flux.2 Klein, GPT-Image-1.5, Grok, Nano Banana Pro, Qwen-Image-Edit, Seedream
1개 입력 및 다중 편집 모델 비교
- Flux, Flux.2 Klein
FLUX.2 [Klein] 4B 증류판: 이미지 편집
- Flux, Flux.2 Klein
FLUX.2 [Klein] 4B: 텍스트 기반 이미지 생성
- Flux, Flux.2 Klein
FLUX.2 [Klein] 4B:이미지 편집
- Flux, Flux.2 Klein
FLUX.2 [Klein] 9B 증류: 이미지 편집
- Flux, Flux.2 Klein
FLUX.2 [Klein] 9B: 이미지 편집
- Flux, Flux.2 Klein
FLUX.2 [Klein] 9B: 텍스트 기반 이미지 생성