🚀 T2I Adapter - Depth
T2I Adapter是一個為Stable Diffusion提供額外條件的網絡。每個T2I檢查點接受不同類型的條件作為輸入,並與特定的基礎Stable Diffusion檢查點一起使用。此檢查點為Stable Diffusion 1.5檢查點提供深度條件。
✨ 主要特性
- 為Stable Diffusion提供額外的深度條件。
- 不同的T2I檢查點可接受不同類型的條件輸入。
📦 安裝指南
依賴安裝
pip install diffusers transformers controlnet_aux
💻 使用示例
基礎用法
from controlnet_aux import MidasDetector
from PIL import Image
from diffusers import T2IAdapter, StableDiffusionAdapterPipeline
import torch
midas = MidasDetector.from_pretrained("lllyasviel/Annotators")
image = Image.open('./images/depth_input.png')
image = midas(image)
image.save('./images/depth.png')
adapter = T2IAdapter.from_pretrained("TencentARC/t2iadapter_depth_sd15v2", torch_dtype=torch.float16)
pipe = StableDiffusionAdapterPipeline.from_pretrained(
"runwayml/stable-diffusion-v1-5", adapter=adapter, safety_checker=None, torch_dtype=torch.float16, variant="fp16"
)
pipe.to('cuda')
generator = torch.Generator().manual_seed(1)
depth_out = pipe(prompt="storm trooper giving a speech", image=image, generator=generator).images[0]
depth_out.save('./images/depth_output.png')
示例圖片

📚 詳細文檔
模型詳情
屬性 |
詳情 |
開發者 |
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許可證。