Views
No views yet

| Model Name | Control Image Overview | Control Image Example | Generated Image Example |
|---|---|---|---|
| lllyasviel/sd-controlnet-canny Trained with canny edge detection | A monochrome image with white edges on a black background. | ![]() | ![]() |
| lllyasviel/sd-controlnet-depth Trained with Midas depth estimation | A grayscale image with black representing deep areas and white representing shallow areas. | ![]() | ![]() |
| lllyasviel/sd-controlnet-hed Trained with HED edge detection (soft edge) | A monochrome image with white soft edges on a black background. | ![]() | ![]() |
| lllyasviel/sd-controlnet-mlsd Trained with M-LSD line detection | A monochrome image composed only of white straight lines on a black background. | ![]() | ![]() |
| lllyasviel/sd-controlnet-normal Trained with normal map | A normal mapped image. | ![]() | ![]() |
| lllyasviel/sd-controlnet_openpose Trained with OpenPose bone image | A OpenPose bone image. | ![]() | ![]() |
| lllyasviel/sd-controlnet_scribble Trained with human scribbles | A hand-drawn monochrome image with white outlines on a black background. | ![]() | ![]() |
| lllyasviel/sd-controlnet_seg Trained with semantic segmentation | An ADE20K's segmentation protocol image. | ![]() | ![]() |
$ pip install controlnet_auxdiffusers and related packages:$ pip install diffusers transformers accelerate1from PIL import Image
2from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
3import torch
4from controlnet_aux import OpenposeDetector
5from diffusers.utils import load_image
6
7openpose = OpenposeDetector.from_pretrained('lllyasviel/ControlNet')
8
9image = load_image("https://huggingface.co/lllyasviel/sd-controlnet-openpose/resolve/main/images/pose.png")
10
11image = openpose(image)
12
13controlnet = ControlNetModel.from_pretrained(
14 "lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16
15)
16
17pipe = StableDiffusionControlNetPipeline.from_pretrained(
18 "runwayml/stable-diffusion-v1-5", controlnet=controlnet, safety_checker=None, torch_dtype=torch.float16
19)
20
21pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
22
23# Remove if you do not have xformers installed
24# see https://huggingface.co/docs/diffusers/v0.13.0/en/optimization/xformers#installing-xformers
25# for installation instructions
26pipe.enable_xformers_memory_efficient_attention()
27
28pipe.enable_model_cpu_offload()
29
30image = pipe("chef in the kitchen", image, num_inference_steps=20).images[0]
31
32image.save('images/chef_pose_out.png')

