얼마전, HiDream이라는 새로운 오픈소스 이미지 생성 AI 가 등장했다는 소식을 알려드렸는데, 드디어 2025년 4월 17일 발표된 ComfyUI v0.3.29에서 HiDream을 지원하게 되었습니다.
HiDream은 현재 인공지능 Text-Image Arena에서 4등을 차지하고 있는데, 오픈소스만 봤을 때는 Black Forest Labs의 Flux와 Stable Diffusion 3.5 등을 제치고 수위를 달리고 있습니다.
소프트웨어
이 글에서는 스테이블 디퓨전용 GUI중에서도 제일 강력하며, 현재 거의 대세로 자리잡고 있는 ComfyUI를 사용합니다. ComfyUI가 처음이시라면, 설치 및 기본 사용방법 및 초보가이드를 확인하시기 바랍니다.
따라하기
1 단계: 모델 다운로드
디퓨전 모델은 여기에 들어 있습니다. ComfyUI\models\diffusion_models 폴더에 다운로드 받으시면 됩니다. 디퓨전모델은 아래와 같이 6개의 파일이 들어 있는데, 모두 다운로드 받으실 필요 없이 자신의 하드웨어에 맞춰 적당한 것을 선택해서 사용하시면 됩니다. 이 워크플로에서는 hidream_i1_dev_bf16.safetensors 를 사용합니다. 모델별 설정 방법은 아래를 읽어보세요.
아래의 파일들을 다운로드 받아, ComfyUI\models\text_encoders에 넣어줍니다. 이 파일들은 여기에 들어가면 한꺼번에 다운로드 받으실 수 있습니다. 이중에서 t5xx... 파일은 Flux에서도 공통적으로 사용하는 파일입니다.
- clip_l_hidream.safetensors
- clip_g_hidream.safetensors
- t5xxl_fp8_e4m3fn_scaled.safetensors
- llama_3.1_8b_instruct_fp8_scaled.safetensors
아래는 VAE 파일입니다. ComfyUI\models\vae 폴더에 넣어주시면 됩니다. 이 파일도 Flux에서 공통으로 사용하는 파일입니다.
2 단계: 워크플로 불러오기
아래의 Json 파일을 다운로드 받아 ComfyUI로 불러옵니다.
이 워크플로를 불러오면 오류가 발생할 수 있습니다. 그러한 경우, 다음과 같은 작업이 필요합니다.
- 처음 사용할 때 - ComfyUI Manager 를 설치해야 합니다.
- ComfyUI를 오랜만에 사용할 때 - ComfyUI를 최신버전으로 업데이트해야 합니다.
- 노드가 없다고 (빨간색) 경고가 뜰 때 - 빠진 커스톰 노드를 가져오기해야 합니다.
- 불러오기 혹은 수행중 에러 발생시 - 커스톰 노드를 업데이트해야 합니다.
가끔은 빠진 커스톰 노드 가져오기를 실행했는데도 계속 같은 오류가 반복될 수 있습니다. 이때에는 ComfyUI를 최신버전으로 업데이트를 해보고, 그래도 안되면 ComfyUI를 새로 설치하여야 합니다.
3 단계: 프롬프트 검토
이 워크플로는 검은색 드래곤을 생성합니다. 프롬프트는 기존의 이미지를 JoyCaption에서 분석하여 생성하였기 때문에 아주 길게 나왔는데,
프롬프트: a highly detailed, hyper-realistic digital artwork of a fearsome dragon. The dragon's head dominates the frame, showcasing its fierce and majestic appearance. Its eyes are a striking, glowing red, exuding an intense and powerful aura. The dragon's face is adorned with intricate, black scales that are meticulously detailed, giving the impression of a glossy, almost wet texture. The scales transition into a lighter, cream-colored mane that cascades down its neck, adding to the regal and formidable look.
The dragon's snout is long and sharp, with a menacing set of teeth that are prominently displayed. A prominent, red gemstone adorns its forehead, adding a touch of elegance and mystique. Long, black whiskers hang from its cheeks, adding to its fierce appearance. The background is a smooth gradient of dark gray, which contrasts sharply with the dragon's vibrant colors and intricate details, making the subject stand out prominently. The lighting is soft yet directional, highlighting the dragon's features and casting subtle shadows that emphasize its three-dimensional form. The overall style of the artwork is highly realistic, with a focus on anatomical accuracy and lifelike textures, making the dragon appear both mythical and tangible.
4 단계: 이미지 생성
이제 [Run] 버튼을 누르면 이미지가 생성됩니다. 샘플링 시간만 약 2:30 정도 소요되네요.
HiDream 모델별 설정
이 워크플로에서는 HiDream_l1_dev 버전을 사용하지만, 다른 모델을 사용할 경우에는 설정을 바꿔줘야 합니다. 설정 방법은 아래와 같습니다.
HiDream Full | HiDream Dev | HiDream Fast |
* hidream_i1_full_fp16.safetensors * shift: 3.0 * steps: 50 * sampler: uni_pc * scheduler: simple * cfg: 5.0 |
* hidream_i1_dev_bf16.safetensors * shift: 6.0 * steps: 28 * sampler: lcm * scheduler: normal * cfg: 1.0 (no negative prompt) |
* hidream_i1_fast_bf16.safetensors * shift: 3.0 * steps: 16 * sampler: lcm * scheduler: normal * cfg: 1.0 (no negative prompt) |
즉, 모델을 바꾸는 것 뿐만 아니라, 아래에 있는 여러가지 설정도 따라 바꿔야하므로, 사실상 다른 워크플로라고 생각하셔도 됩니다. 그리고 여기에 있는 모델중 fp8 버전이 있는데, bf16 버전으로 돌렸을 때 메모리 에러가 발생할 때 대체하여 사용하시면 됩니다.
이 글은 ComfyUI Examples 글을 참고하여 작성하였습니다.