기본 콘텐츠로 건너뛰기

Wan2.2 gguf Text to Image - Comfyui 에 의한 고화질 이미지 생성

 Wan2.2 모델은 알리바바(Alibaba)에서 개발한 오픈소스 AI 비디오 생성 모델이며,  기존 Wan2.1 보다 더 사실적이고 높은 품질의 영상을 만들 수 있다는 점이 가장 큰 특징이다.

주로 text to video 또는 image to video 를 제작하는데 사용되나 Wan2.1 text to video 모델을 이용하여 text to image 를 생성해 보면  Flux1-dev 모델보다 더 높은 품질과 사실적인 이미지를 얻을 수 있다.  물론 모델이 크기 때문에 생성시간이 조금 더 많이 소요되지만,  gguf 모델을 이용하면 그래도 1분30초 정도에 생성 할 수 있다.  (4070t vram 16G 환경하에서) 
gguf 모델은 작은 vram 과 적은 스텝으로도 비슷한 품질의 이미지를 얻을 수 있기 때문에 많이 사용하는 모델이다.
Wan2.2 모델을 이용하여 생성된 이미지
이미지는 1536x1536 으로 생성된 고품질의 이미지 이다.  확대해 보면 생생한 질감을 느낄 수 있다.

1.  Wan2.2-t2v 및 관련 모델 다운로드

  • wan2.2_t2v_high_noise_14B_Q5_K_S.gguf 와 wan2.2_t2v_low_noise_14B_Q5_K_S.gguf  : https://huggingface.co/bullerwins/Wan2.2-T2V-A14B-GGUF/tree/main 에서 다운 받거나  구글에서 검색해도 다운 받을 곳을 찾을 수 있다. 
  • Q2 -> Q8 으로 갈수록 파일크기가 커지며 좀 더 좋은 품질의 이미지를 얻을 수 있지만 Q4 이상이면 보통 품질의 차이를 별로 느끼기 어렵기 때문에 여기서는 Q5 모델을 사용 하였다.
  • CLIP Model  umt5-xxl-encoder-Q5_K_S : https://huggingface.co/city96/umt5-xxl-encoder-gguf/tree/main 에서 다운받아 설치한다.
  • VAE 모델은 Wan2.1 것을 그대로 사용하면 된다.
  • Loras : 좀 더 빠른 이미지 생성을 위하여 다음 2 종류 lora 를 사용한다. 
    • Wan2.2-Lightning_T2V-v1.1-A14B-4steps-lora_LOW_fp16
    • Wan2.2-Lightning_T2V-v1.1-A14B-4steps-lora_HIGH_fp16
    • 다운 로드는 https://huggingface.co/Kijai/WanVideo_comfy/tree/main/Wan22-Lightning 에서 받을 수 있다.

2. Workflow 구성

이 그림을 그대로 다운받아 Comfyui에 drop 해도 된다.

  • Wan2.2 는 Diffusion Model 이 High 와 Low 2 종류을 사용한다.
  • Lora 도 High 와 Low 각각 적용해야 하며
  • Ksampler (Advanced)  를 각각 사용한다.
  • gguf 이기 때문에 Steps 는 4 Steps 로 하는데 High 에서 0~2 까지 설정하고, Low 에서 2~ 4 로 설정하면 된다.  workflow 에는 2~ 10000 으로 되어 있는데 상관없이 똑같은 결과이다.
  • cfg : 1.0
  • Sampler : res_2s
  • Scheduler : bong_tangent
  • WanVideoNAG 노드는 nagative prompt 를 더 정확히 적용하기 위하여 사용하는 노드이다.
  • Clean VRAM Used 와 Clear Cache All 노드는 메모리 청소용 노드이기 때문에 없어도 이미지 생성에 문제없다.

3. 이미지 생성

  • Prompt : I want a vivid, high-quality image of a solitary,randomly selected piece of furniture, majestically lit and artfully styled, set against a clean, minimalist background that makes the furniture the sole focal point,  with a mix of warm and cool tones, and a shallow depth of field to draw the viewer's attention to the intricate details and textures of the furniture, capturing its unique shape, material, and craftsmanship, inviting the viewer to imagine it in their own home or workspace.
piece of furniture
확대해 보면 의자의 detail 이 생생하다.  실제 의자를 사진 찍어 놓은듯한 고품질 이미지 이다.

  • Prompt : A sophisticated heart-shaped locket made from polished platinum, with an intricate filigree design of two lovers’ silhouettes carved into the front. The interior holds a hidden compartment, framed with delicate rose gold, perfect for keeping a cherished memory. The outer surface is adorned with small pave-set diamonds, creating a soft, shimmering glow. A single heart-shaped ruby rests at the clasp, symbolizing the preciousness of love held within.
A sophisticated heart-shaped locket
정교하고 우아한 디자인의 목걸이 을 묘사 하였다.
실존하는 목걸이의 느낌이 목걸이를 소유하고픈 충동을 일으킨다.

  • Prompt : A dazzling Korean idol with long, silky black hair styled in soft, cascading waves that flow effortlessly down her back, wearing an elegant, form-fitting white dress that accentuates her graceful and slender silhouette. The dress features subtle shimmering details and delicate lacework, exuding a timeless charm with a modern flair. Her radiant features are highlighted by light, natural makeup that emphasizes her almond-shaped eyes, filled with a captivating sparkle that speaks of confidence and charisma. She stands against a vibrant stage-inspired backdrop, where glowing spotlights and shimmering confetti fill the air, creating an electrifying yet glamorous atmosphere. The setting captures the essence of her stardom, blending poise and allure with the dynamic energy of a live performance.
Korean idol woman
한국 idol 가수의 무대의상을 입은 모습을 만들어 보았다.
Wan2.2 는 알리바바(중국)에서 만든 모델이기 때문에 우리나라 여성 이미지도 많이 포함하여 훈련을 시킨듯 하다.  특별한 lora 없이도 아름다운 한국여성을 요구하면 잘 만들어 준다.

  • Prompt : Create an exquisite advertisement for "Velouré", a fragrance that exudes sophistication, warmth, and undeniable charm. The perfume combines rich, sensual notes of sandalwood, amber, and vanilla, with a light touch of pear and freesia, offering a harmonious blend that is both luxurious and inviting. The bottle is a soft, radiant rose gold, with a sleek, modern silhouette that captures the essence of femininity and refinement. Its smooth, elegant curves mirror the grace and allure of the scent inside. In the advertisement, the bottle should be highlighted against a soft-focus background with warm, inviting lighting, emphasizing the perfume’s luxurious, feminine appeal.
advertisement for fragrance
 "Velouré" 라는 향수 광고 이미지를 요청하였는데 비교적 작 만들어 졌다. 하지만 글씨는 약간 아쉬운 부분이 많다.  간단한 단어는 잘 표현해도 좀 길어진 문장의 경우는 어렵다. text 구사 능력은 Flux 나 QWEN 모델이 더 낫다.

Prompt : A black and white pen drawing of a serene lakeside scenery. with calm waters reflecting tall, slender trees and distant hills. A small red boat floats gently on the lake, creating a striking contrast with the monochrome environment. bold black outlines, Arrange perfectly within a bird-shaped frame,torn edges, maintaining a balanced and harmonious layout. 
carefully refining the masterpiece , Soft lighting enhances the tranquility of the scene and the meticulous artistry, creating an award-winning composition.
The drawing features astonishingly fine details, with a sense of depth and texture achieved through varying line thicknesses and shading. The style blends modern realism with lace-like intricacy, capturing the peaceful, reflective, and whimsical essence of the scenery.
pen drawing of a serene lakeside scenery
호숫가 전경을 그린 펜 드로잉 이미지.   Lora 없이도 펜 드로잉 이미지를 잘 구현 해 준다.

4. Wan2.2 gguf 로 이미지를 만들어본 결과

  •     gguf 모델이기 때문에 4 스텝으로 이미지 생성이 가능하며 시간을 절약할 수있다.
  • 중국 알리바바에서 만든 모델이기 때문에 한국 여성 뿐 아니라 동양인의 묘사가 각 나라 별로 구분 되어 표현된다.  기존 flux 나  stable diffusion 에서는 한국, 일본 이나 중국 여성의 이미지가 구분이 잘 안가는데 Wan2.2 에서는 딱 봐도 한국 여성 느낌이 난다.
  • 1536x1536 으로 만들어 확대 해 보면 섬세한 표현이 매우 사실적이고 고 품질이다.
  • Text 표현은 보통 수준으로 상세한 내용까지는 어렵다.
아쉽지만 우리나라에서도 이런 모델을 만들어 줄 곳이 있으면 좋을텐데, 아마도 그럴리는 없을것이다.  중국은 워낙 인구가 많아 시장성이 있지만 우리나라는 시장의 규모가 작아 한국어 표현이 가능한 모델을 출시하기는 어려울 것이다.  AI 의 발전 속도로 보았을때  선두주자는 미국이고 두번째 주자는 중국이 확실할 것이다.  

5.  다른 쓸만한 이미지 몇개

캔버스에 그리는 흑백 드로잉 옷은 붉은 색으로 강조를 하였다.



추상적인 무늬를 배경으로 포즈를 취하는 여성 이미지
여름 이국적인 화보 촬영 이미지 이다.

Embroidered Mesh Top: a stylish black Tulle blouse with a sheer overlay
  • Prompt : Embroidered Mesh Top: a stylish black Tulle blouse with a sheer overlay. The blouse has long sleeves and is designed with a fitted bodice that includes a gathered effect at the front, creating a ruched appearance. The sheer material gives it an elegant and delicate look, while the internal structure suggests a structured fit around the bust area. There are tie details that add a touch of sophistication and versatility to the garment, Made from sheer mesh fabric with intricate ruby red embroidery, creating an alluring and textured look. Tulle Skirt: The skirt is tailored with a high waist and has an asymmetrical hemline, creating an elegant silhouette. On one side, there is a vertical slit. Sitting with legs slightly apart, gently biting their finger, and looking playfully at the camera 
prompt 로 좀 더 상세한 의상을 요구하면 대체적으로 잘 만들어 준다.

Black and white pen drawing
강아지와 아기 고양이의 장난하는 모습을 흑백 드로잉으로 표현한 이미지 이다.

여러가지 이미지를 만들어 보면 Wan2.2 에서 잘 만들어 주는 이미지가 있고 , 어떤 것은 prompt 에 비하여 생각보다 잘 못 만들어 주는 것들도 있다.  모델에 맞추어 다양하게 사용하는 것이 좋을 듯하다.

이제는 폭염이 지나갔나 보다.
다만 폭우가 아직도 위협하는 여름이다.



댓글

이 블로그의 인기 게시물

Comfyui Wildcard 사용법 - Stable Diffusion , Flux 에서 쉽게 Random Prompt 로 이미지 만들기

 Comfyui Wildcard 사용법에 대하여 알아본다. Comfyui 로 Stable Diffusion 또는 Flux 로 이미지를 만들 때 Prompt 가 이미지를 결정하는데 매우 중요한 역할을 한다.  영어가 모국어가 아닌 이상 영어로 prompt 를 만드는 것이 참 어려운 일이다. 물론 처음에는 많은 다른 사람들이 사용한 prompt 들을 모방하여 수정하고 사용하는데 이런 일을 하나하나 해 보기가 시간이 많이 걸리고 어렵다.   그래서 Random 으로 prompt 가 만들어 져서 이미지가 생성되고 그 이미지 중에서 마음에 드는 이미지들을 골라 그 이미지의 Prompt들 만을 가지고 보완하고 개선하면 더 편리하고 좋지 않을까 생각이 든다.  그런 식의 Random Prompt 생성이 가능하게 해주는 것이 wildcard 사용이다. Joker는 card game에서 wildcard 이다. 1. Wildcard 의 의미      와일드 카드(Wildcard)란 카드 게임에서 유래되었다.  이런 카드 게임에서 모든 카드의 대용으로 쓸 수 있는 비장의 카드를 와일드 카드라고 한다. 포커나 훌라를 할 때 조커가 이런 역할을 하는데 ,  이 의미가 컴퓨터와 스포츠로 확장되어 사용되는 것이다. 컴퓨터 용어로 쓰일 때는 한 디렉터리 내에 여러 파일이 존재하거나, 파일 이름의 뒷부분을 정확히 알지 못하는 경우에도 사용할 수 있는 명령어를 말합니다. '*'을 넣으면 빠진 것에 어떤 문자열이 있든지 대신할 수 있고,  '?'는 임의의 한 문자에만  대응한다. Comfyui 에서 wildcard 사용은 "--문자열--"  이런 식으로 wildcard 사용 가능한 노드에 prompt 를 입력해 주면 그 노드는 "문자열" 에  해당되는 파일을 찾아 그 파일 내용 중에서 임의의 일부분을 prompt 로 대체해 준다. 2. Wildcard 사...

Flux Lora 제작 - Local 에서 Fluxgym 을 이용하여 자체 Lora 만들기

 Flux Lora 는 일관된 이미지를 만드는데 꼭 필요하다. 특히 일관된 얼굴의 이미지를 만드는데 있어서 다른 기능들 (ipadapter , controlnet, imgtoimg 등) 을 이용하는 것 보다 훨씬 일정한 캐릭터를 생성하게 해준다.  문제는 이런 Lora는 주로 CIVITAI , Tensor, Hugging face 등 사이트에서 다운 받아 사용하면 되지만  그것은 나만의 독특한 캐릭터가 아니고 나의 취향과 일치 되기가 어려워서 Lora를 구하기가 어렵다.  아니면 그런 사이트 내에서 자체 Lora를 제작하면 되는데 모두 비용이 필요하다. 여기 소개하는 Fluxgym AI 는 Local 컴퓨터에서 VRAM 12G 이상이면 자체 Lora를 만들 수 있게 해준다.   소요되는 시간도 생각보다 많이 걸리지 않는다.   이제 설치하고 자체 Lora를 한번 만들어 보자. Fluxgym 으로 만든 Lora 대표이미지 1. fluxgym 설치 pinokio 앱을 실행한다. ( pinokio 앱 설치 참조 ) 우측 상단 맨 처음 아이콘 (discover) 클릭 fluxgym 을 찾아서 클릭 fluxgym 이것을 클릭하면 된다. 여러가지 파일들을 설치하기 때문에 시간이 좀 소요될 것이다. 모든 설치가 끝나면 pinokio 브라우저 하단 부분에 fluxgym 메뉴가 추가된다. fluxgym 나중에 불필요하면 삭제(쓰레기통 아이콘 클릭) 하면 모두 unintall 된다. 2. fluxgym 실행 항상 pinokio 앱을 실행하여 pinokio 브라우저에서 fluxgym 을 클릭하면 된다. flux화면3-1 -. 1번항 : 여기에 입력한 대로 fluxgym/outputs/ 의 하위 폴더를 만들어 준다. -. 2번항 : Lora를 작동시키는 trigger word 를 입력한다. (예,  hart_style_a......) -. 3번항 : 자신의 가능한 VRAM 선택 : 나는 12 G 선택 ...

Pinokio 앱 설치 - 오픈 소스 AI 플랫폼

  Pinokio 는 오픈 소스 AI 플랫폼이다. 로컬에서 AI 애플리케이션을 쉽게 설치하고 실행할 수 있게 도와주는 오픈 소스 AI 플랫폼이다. 이 플랫폼은 사용자가 복잡한 설치 과정 없이 클릭 한 번으로 AI 도구들을 설치할 수 있도록 설계되어 있다. 이를 통해 기술적인 배경 지식이 없는 초보자나 비전문가들도 쉽게 AI 애플리케이션을 사용할 수 있다.   이미 설치되어 있는 애플리케이션이 있어도 별도의 독립된 공간에서 문제없이 사용할 수 있게 해준다.   우리가 stable diffusion 을 comfyui 에서 사용하기 위해서는 "Python", "git ....", "conda"  뭔지 모르지만 설치해야 하는데 pinokio 브라우저에서 원 클릭으로 알아서 설치를 해주기 때문에  컴맹인 일반인도 쉽게 설치하고 사용 할 수 있다. pinokio.computer 1. Pinokio 주요 기능 원클릭 설치 : 복잡한 환경 설정이나 명령어 입력 없이도 다양한 AI 모델을 한 번의 클릭으로 설치할 수 있다. 예를 들어, Comfyui 나 Flux 같은 AI 도구들을 손쉽게 설치할 수 있다. 다양한 AI 애플리케이션 제공 : Pinokio는 다양한 오픈 소스 AI 애플리케이션을 제공하는 허브 역할을 하며, Pinokio 브라우저 나 홈페이지에서 쉽게 찾아 설치할 수 있다. 브라우저 기반 인터페이스 : 모든 설치된 애플리케이션은 Pinokio 웹 브라우저에서 관리할 수 있어, 친숙한 인터페이스로 쉽게 사용이 가능하다. 독립적인 가상 컴퓨터 : Pinokio는 백엔드 작업을 자동으로 처리하여, 애플리케이션이 로컬에서 실행되는 동안 인터넷에 연결되어 있지 않아도 된다. 2. Pinokio 설치 구글에서 pinokio 를 검색하여 " pinokio.computer " 를 클릭 Download 클릭 다운로드 된 pinokio 압축 파일을  푼다. pinokio 설치파일을 실행하여 설치 설치과정은 복...