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 transformers1from PIL import Image
2import torch
3from diffusers import StableDiffusionAdapterPipeline, T2IAdapter
4
5image = Image.open('./images/color_ref.png')
6
7color_palette = image.resize((8, 8))
8color_palette = color_palette.resize((512, 512), resample=Image.Resampling.NEAREST)
9
10color_palette.save('./images/color_palette.png')
11
12adapter = T2IAdapter.from_pretrained("TencentARC/t2iadapter_color_sd14v1", torch_dtype=torch.float16)
13pipe = StableDiffusionAdapterPipeline.from_pretrained(
14 "CompVis/stable-diffusion-v1-4",
15 adapter=adapter,
16 torch_dtype=torch.float16,
17)
18pipe.to("cuda")
19
20generator = torch.manual_seed(0)
21
22out_image = pipe(
23 "At night, glowing cubes in front of the beach",
24 image=color_palette,
25 generator=generator,
26).images[0]
27
28out_image.save('./images/color_out_image.png')

