Views
No views yet
| Model Name | Control Image Overview | Control Image Example | Generated Image Example |
|---|---|---|---|
| TencentARC/t2iadapter_color_sd14v1 Trained with spatial color palette | A image with 8x8 color palette. | ![]() | ![]() |
| TencentARC/t2iadapter_canny_sd14v1 Trained with canny edge detection | A monochrome image with white edges on a black background. | ![]() | ![]() |
| TencentARC/t2iadapter_sketch_sd14v1 Trained with PidiNet edge detection | A hand-drawn monochrome image with white outlines on a black background. | ![]() | ![]() |
| TencentARC/t2iadapter_depth_sd14v1 Trained with Midas depth estimation | A grayscale image with black representing deep areas and white representing shallow areas. | ![]() | ![]() |
| TencentARC/t2iadapter_openpose_sd14v1 Trained with OpenPose bone image | A OpenPose bone image. | ![]() | ![]() |
| TencentARC/t2iadapter_keypose_sd14v1 Trained with mmpose skeleton image | A mmpose skeleton image. | ![]() | ![]() |
| TencentARC/t2iadapter_seg_sd14v1 Trained with semantic segmentation | An custom segmentation protocol image. | ![]() | ![]() |
| TencentARC/t2iadapter_canny_sd15v2 | |||
| TencentARC/t2iadapter_depth_sd15v2 | |||
| TencentARC/t2iadapter_sketch_sd15v2 | |||
| TencentARC/t2iadapter_zoedepth_sd15v1 |
pip install diffusers transformers controlnet_aux1import torch
2from PIL import Image
3from controlnet_aux import PidiNetDetector
4
5from diffusers import (
6 T2IAdapter,
7 StableDiffusionAdapterPipeline
8)
9
10image = Image.open('./images/sketch_in.png')
11
12processor = PidiNetDetector.from_pretrained('lllyasviel/Annotators')
13
14sketch_image = processor(image)
15
16sketch_image.save('./images/sketch.png')
17
18adapter = T2IAdapter.from_pretrained("TencentARC/t2iadapter_zoedepth_sd15v1", torch_dtype=torch.float16)
19pipe = StableDiffusionAdapterPipeline.from_pretrained(
20 "CompVis/stable-diffusion-v1-4", adapter=adapter, safety_checker=None, torch_dtype=torch.float16, variant="fp16"
21)
22
23pipe.to('cuda')
24
25generator = torch.Generator().manual_seed(0)
26
27sketch_image_out = pipe(prompt="royal chamber with fancy bed", image=sketch_image, generator=generator).images[0]
28
29sketch_image_out.save('./images/sketch_image_out.png')

