Kandinsky 3.1
세부 정보
파일 다운로드
모델 설명
이것은 안정적인 확산 모델이 아닙니다. 전용 웹 UI가 필요합니다. 자세한 정보는 아래를 참조하세요.
참고: 저는 이 모델의 작성자가 아닙니다. 원본 HF 리포지토리 링크는 아래에 있습니다.
Kandinsky 3.1을 이제 사용할 수 있습니다:
Apache 2.0 라이선스 하에 공개된 모델 소스 코드는 GitHub에서 확인할 수 있습니다: https://github.com/ai-forever/Kandinsky-3
모델은 Hugging Face에서 다운로드 및 사용 가능합니다: https://huggingface.co/ai-forever/Kandinsky3.1
로컬 사용을 위한 모델 전용 "AUTOMATIC1111": Kubin은 다음 링크에서 제공됩니다: https://github.com/seruva19/kubin
FusionBrain 웹사이트에서 Kandinsky의 기능을 테스트할 수 있습니다: https://www.sberbank.com/promo/kandinsky/
리포지토리 원본 설명:
license: apache-2.0
Kandinsky-3: 텍스트-이미지 확산 모델
Kandinsky 3.0 포스트 | Kandinsky 3.1 포스트 | 프로젝트 페이지 | 생성하기 | Telegram 봇 | 기술 보고서 | HuggingFace
Kandinsky 3.1:
설명:
우리는 Kandinsky 3.0 모델의 후속 버전인 Kandinsky 3.1을 발표합니다. 이는 잠재적 확산 기반의 대규모 텍스트-이미지 생성 모델로, 텍스트-이미지 Kandinsky 시리즈를 이어가며 이미지 생성의 품질과 사실성을 향상시키기 위한 우리의 진전을 반영합니다. 우리는 다양한 유용한 기능과 모드를 추가하여 사용자가 새로운 모델의 강력한 기능을 더욱 충분히 활용할 수 있도록 했습니다.
Kandinsky Flash (Kandinsky 3.0 리파이너)

확산 모델은 빠른 이미지 생성에 어려움을 겪습니다. 이 문제를 해결하기 위해, 우리는 적대적 확산 증류(Adversarial Diffusion Distillation) 접근 방식을 기반으로 Kandinsky Flash 모델을 훈련했습니다. 일부 수정을 가해, 잠재 공간에서 모델을 훈련함으로써 메모리 오버헤드를 줄이고, 증류 손실을 제거했습니다(증류 손실은 훈련에 영향을 주지 않았기 때문입니다). 또한, Kandinsky Flash 모델을 Kandinsky 3.0에서 생성된 이미지에 적용하여 생성된 이미지의 시각적 품질을 향상시켰습니다.
아키텍처
Kandinsky Flash를 훈련하기 위해 우리는 다음과 같은 판별기 아키텍처를 사용했습니다. 이는 Kandinsky 3.0 U-Net 인코더의 절반에 추가적인 헤드 예측을 더한 구조입니다.

사용 방법:
./examples 폴더의 예제를 포함한 jupyter 노트북을 확인하세요.
from kandinsky3 import get_T2I_Flash_pipeline
device_map = torch.device('cuda:0')
dtype_map = {
'unet': torch.float32,
'text_encoder': torch.float16,
'movq': torch.float32,
}
t2i_pipe = get_T2I_Flash_pipeline(
device_map, dtype_map
)
res = t2i_pipe("A cute corgi lives in a house made out of sushi.")
Kandinsky 인페인팅
또한, 우리는 객체 감지 데이터셋을 추가로 훈련한 새 버전의 인페인팅 모델을 공개했습니다. 이를 통해 객체 생성의 안정성이 향상되었습니다. 새로운 가중치는 ai-forever/Kandinsky3.1에서 사용할 수 있습니다. 사용법은 예제를 참조하세요.
프롬프트 개선

텍스트-이미지 생성에서 프롬프트는 핵심적인 역할을 합니다. 따라서 Kandinsky 3.1에서는 언어 모델을 사용해 프롬프트를 개선하기로 결정했습니다. 우리는 Intel의 neural-chat-7b-v3-1을 다음과 같은 시스템 프롬프트와 함께 LLM로 사용했습니다:
### System: You are a prompt engineer. Your mission is to expand prompts written by user. You should provide the best prompt for text to image generation in English.
### User:
{prompt}
### Assistant:
{answer of the model}
KandiSuperRes

KandiSuperRes에 대한 자세한 정보는 다음을 확인하세요: https://github.com/ai-forever/KandiSuperRes/
Kandinsky IP-Adapter & Kandinsky ControlNet

Kandinsky 모델에서 이미지를 조건으로 사용할 수 있도록, 우리는 IP-Adapter와 HED 기반 ControlNet 모델을 훈련했습니다. 자세한 내용은 다음을 참조하세요: https://github.com/ai-forever/kandinsky3-diffusers
Kandinsky 3.0:
설명:
Kandinsky 3.0은 Kandinsky2-x 모델 계열을 기반으로 구축된 오픈소스 텍스트-이미지 확산 모델입니다. 이전 버전들과 비교하여, Kandinsky 3.0은 더 많은 데이터를 포함하며 특히 러시아 문화와 관련된 데이터에 중점을 두어 러시아 문화와 관련된 이미지를 생성할 수 있습니다. 또한, 텍스트 인코더와 확산 U-Net 모델의 크기를 증가시켜 텍스트 이해력과 시각적 품질을 개선했습니다.
자세한 정보: 훈련 세부사항 및 생성 예제는 포스트를 확인하세요. 영문 버전은 며칠 내로 공개될 예정입니다.
아키텍처 세부정보:
아키텍처는 세 부분으로 구성됩니다:
텍스트 인코더 Flan-UL2 (인코더 부분) - 8.6B
잠재적 확산 U-Net - 3B
MoVQ 인코더/디코더 - 267M
모델
우리는 두 가지 모델을 공개합니다:
베이스: 베이스 텍스트-이미지 확산 모델. 이 모델은 400개의 A100에서 2M 스텝 동안 훈련되었습니다.
인페인팅: 인페인팅 버전 모델. 이 모델은 베이스 모델의 최종 체크포인트를 초기화하여 300개의 A100에서 250k 스텝 동안 훈련되었습니다.
설치
레포지토리를 설치하려면 먼저 conda 환경을 생성해야 합니다:
conda create -n kandinsky -y python=3.8;
source activate kandinsky;
pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/cu113/torch_stable.html;
pip install -r requirements.txt;
정확한 종속성은 pip freeze를 통해 얻었으며, exact_requirements.txt 파일에서 확인할 수 있습니다.
사용 방법:
./examples 폴더의 예제를 포함한 jupyter 노트북을 확인하세요.
1. text2image
import sys
sys.path.append('..')
import torch
from kandinsky3 import get_T2I_pipeline
device_map = torch.device('cuda:0')
dtype_map = {
'unet': torch.float32,
'text_encoder': torch.float16,
'movq': torch.float32,
}
t2i_pipe = get_T2I_pipeline(
device_map, dtype_map,
)
res = t2i_pipe("A cute corgi lives in a house made out of sushi.")
res[0]
2. inpainting
from kandinsky3 import get_inpainting_pipeline
device_map = torch.device('cuda:0')
dtype_map = {
'unet': torch.float16,
'text_encoder': torch.float16,
'movq': torch.float32,
}
pipe = get_inpainting_pipeline(
device_map, dtype_map,
)
image = ... # PIL 이미지
mask = ... # Numpy 배열 (HxW). 이미지를 마스킹할 위치에 1을 설정
image = inp_pipe( "A cute corgi lives in a house made out of sushi.", image, mask)
저자
Vladimir Arkhipkin: Github
Anastasia Maltseva Github
Andrei Filatov Github,
Igor Pavlov: Github
Julia Agafonova
인용
@misc{arkhipkin2023kandinsky,
title={Kandinsky 3.0 Technical Report},
author={Vladimir Arkhipkin and Andrei Filatov and Viacheslav Vasilev and Anastasia Maltseva and Said Azizov and Igor Pavlov and Julia Agafonova and Andrey Kuznetsov and Denis Dimitrov},
year={2023},
eprint={2312.03511},
archivePrefix={arXiv},
primaryClass={cs.CV}
}

















