Views
No views yet
diffusers format.
It can be used in combination with Stable Diffusion, such as runwayml/stable-diffusion-v1-5.
diffusers and related packages:$ pip install diffusers transformers accelerate1import torch
2import os
3from huggingface_hub import HfApi
4from pathlib import Path
5from diffusers.utils import load_image
6from PIL import Image
7import numpy as np
8
9from diffusers import (
10 ControlNetModel,
11 StableDiffusionControlNetPipeline,
12 UniPCMultistepScheduler,
13)
14
15checkpoint = "lllyasviel/control_v11e_sd15_ip2p"
16
17image = load_image("https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/input.png").convert('RGB')
18
19prompt = "make it on fire"
20
21controlnet = ControlNetModel.from_pretrained(checkpoint, torch_dtype=torch.float16)
22pipe = StableDiffusionControlNetPipeline.from_pretrained(
23 "runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16
24)
25
26pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
27pipe.enable_model_cpu_offload()
28
29generator = torch.manual_seed(0)
30image = pipe(prompt, num_inference_steps=30, generator=generator, image=image).images[0]
31
32image.save('images/image_out.png')
33

| Model Name | Control Image Overview | Condition Image | Control Image Example | Generated Image Example |
|---|---|---|---|---|
| lllyasviel/control_v11p_sd15_canny | Trained with canny edge detection | A monochrome image with white edges on a black background. | ![]() | ![]() |
| lllyasviel/control_v11e_sd15_ip2p | Trained with pixel to pixel instruction | No condition . | ![]() | ![]() |
| lllyasviel/control_v11p_sd15_inpaint | Trained with image inpainting | No condition. | ![]() | ![]() |
| lllyasviel/control_v11p_sd15_mlsd | Trained with multi-level line segment detection | An image with annotated line segments. | ![]() | ![]() |
| lllyasviel/control_v11f1p_sd15_depth | Trained with depth estimation | An image with depth information, usually represented as a grayscale image. | ![]() | ![]() |
| lllyasviel/control_v11p_sd15_normalbae | Trained with surface normal estimation | An image with surface normal information, usually represented as a color-coded image. | ![]() | ![]() |
| lllyasviel/control_v11p_sd15_seg | Trained with image segmentation | An image with segmented regions, usually represented as a color-coded image. | ![]() | ![]() |
| lllyasviel/control_v11p_sd15_lineart | Trained with line art generation | An image with line art, usually black lines on a white background. | ![]() | ![]() |
| lllyasviel/control_v11p_sd15s2_lineart_anime | Trained with anime line art generation | An image with anime-style line art. | ![]() | ![]() |
| lllyasviel/control_v11p_sd15_openpose | Trained with human pose estimation | An image with human poses, usually represented as a set of keypoints or skeletons. | ![]() | ![]() |
| lllyasviel/control_v11p_sd15_scribble | Trained with scribble-based image generation | An image with scribbles, usually random or user-drawn strokes. | ![]() | ![]() |
| lllyasviel/control_v11p_sd15_softedge | Trained with soft edge image generation | An image with soft edges, usually to create a more painterly or artistic effect. | ![]() | ![]() |
| lllyasviel/control_v11e_sd15_shuffle | Trained with image shuffling | An image with shuffled patches or regions. | ![]() | ![]() |
| lllyasviel/control_v11f1e_sd15_tile | Trained with image tiling | A blurry image or part of an image . | ![]() | ![]() |