🚀 T2I Adapter - Sketch
T2I Adapter是一個為穩定擴散模型提供額外條件控制的網絡。每個T2I檢查點接收不同類型的條件作為輸入,並與特定的基礎穩定擴散檢查點一起使用。此檢查點為穩定擴散1.4檢查點提供草圖條件控制。
🚀 快速開始
依賴安裝
pip install diffusers transformers controlnet_aux
運行代碼
import torch
from PIL import Image
from controlnet_aux import PidiNetDetector
from diffusers import (
T2IAdapter,
StableDiffusionAdapterPipeline
)
image = Image.open('./images/sketch_in.png')
processor = PidiNetDetector.from_pretrained('lllyasviel/Annotators')
sketch_image = processor(image)
sketch_image.save('./images/sketch.png')
adapter = T2IAdapter.from_pretrained("TencentARC/t2iadapter_zoedepth_sd15v1", torch_dtype=torch.float16)
pipe = StableDiffusionAdapterPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4", adapter=adapter, safety_checker=None, torch_dtype=torch.float16, variant="fp16"
)
pipe.to('cuda')
generator = torch.Generator().manual_seed(0)
sketch_image_out = pipe(prompt="royal chamber with fancy bed", image=sketch_image, generator=generator).images[0]
sketch_image_out.save('./images/sketch_image_out.png')
示例圖片

✨ 主要特性
T2I Adapter能夠為穩定擴散模型提供額外的條件控制,通過不同的檢查點接收不同類型的條件輸入,從而實現更豐富、更可控的文本到圖像生成。
📚 詳細文檔
模型詳情
屬性 |
詳情 |
開發者 |
《T2I-Adapter: Learning Adapters to Dig out More Controllable Ability for Text-to-Image Diffusion Models》團隊 |
模型類型 |
基於擴散的文本到圖像生成模型 |
語言 |
英文 |
許可證 |
Apache 2.0 |
更多信息資源 |
GitHub倉庫,論文 |
引用信息
@misc{
title={T2I-Adapter: Learning Adapters to Dig out More Controllable Ability for Text-to-Image Diffusion Models},
author={Chong Mou, Xintao Wang, Liangbin Xie, Yanze Wu, Jian Zhang, Zhongang Qi, Ying Shan, Xiaohu Qie},
year={2023},
eprint={2302.08453},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
檢查點
📄 許可證
本項目採用Apache 2.0許可證。