How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("alibaba-pai/pai-diffusion-general-large-zh-controlnet-depth", dtype=torch.bfloat16, device_map="cuda")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]

Chinese Latent Diffusion Model

我们开源了适配模型 alibaba-pai/pai-diffusion-general-large-zh 的 ControlNet,输入图像的 Depth 特征,进行可控的生成。

from diffusers import StableDiffusionControlNetPipeline, ControlNetModel


controlnet_id = "alibaba-pai/pai-diffusion-general-large-zh-controlnet-depth"
controlnet = ControlNetModel.from_pretrained(controlnet_id)
model_id = "alibaba-pai/pai-diffusion-general-large-zh"
pipe = StableDiffusionControlNetPipeline.from_pretrained(model_id, controlnet=controlnet)
pipe = pipe.to("cuda")

image = Image.open("depth_image.png")
prompt = "雪地上的帐篷"
image = pipe(prompt, image).images[0]
image.save("result.png")
Downloads last month
3
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support