Views
No views yet
diffusers is 0.20.2 with torch 2.1import torch
2import requests
3from PIL import Image
4from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler, ControlNetModel
5
6# Load the pipeline
7pipeline = DiffusionPipeline.from_pretrained(
8 "sudo-ai/zero123plus-v1.1", custom_pipeline="sudo-ai/zero123plus-pipeline",
9 torch_dtype=torch.float16
10)
11pipeline.add_controlnet(ControlNetModel.from_pretrained(
12 "sudo-ai/controlnet-zp11-depth-v1", torch_dtype=torch.float16
13), conditioning_scale=0.75)
14# Feel free to tune the scheduler
15pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(
16 pipeline.scheduler.config, timestep_spacing='trailing'
17)
18pipeline.to('cuda:0')
19# Run the pipeline
20cond = Image.open(requests.get("https://d.skis.ltd/nrp/sample-data/0_cond.png", stream=True).raw)
21depth = Image.open(requests.get("https://d.skis.ltd/nrp/sample-data/0_depth.png", stream=True).raw)
22result = pipeline(cond, depth_image=depth).images[0]
23result.show()
24result.save("output.png")