Aller au contenu
ModelPrésentéExterne
Télécharger

Sd21 ControlNet Canny

Converted Canny SD 2.1-base model from to diffusers format.

TypeControlNetVersiondiffusion_pytorch_modelBClasse

Source du modèle

Type
ControlNet
Taille du fichier
695 MB
Version
vdiffusion_pytorch_model
Mis à jour
6 oct. 2026
Téléchargements
18
Source
Hugging Face

Description de la source

Converted Canny SD 2.1-base model from https://huggingface.co/thibaud/controlnet-sd21/ to diffusers format.

Saved only ControlNet weights

Usage:

from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, DEISMultistepScheduler
import cv2
from PIL import Image
import numpy as np

pipe = StableDiffusionControlNetPipeline.from_pretrained(
    "stabilityai/stable-diffusion-2-1-base",
    safety_checker=None,
    # revision='fp16',
    # torch_dtype=torch.float16,
    controlnet=ControlNetModel.from_pretrained("thepowefuldeez/sd21-controlnet-canny")
).to('cuda')
pipe.scheduler = DEISMultistepScheduler.from_config(pipe.scheduler.config)

image = np.array(Image.open("10.png"))

low_threshold = 100
high_threshold = 200

image = cv2.Canny(image, low_threshold, high_threshold)
image = image[:, :, None]
image = np.concatenate([image, image, image], axis=2)
canny_image = Image.fromarray(image)

im = pipe(
    "beautiful woman", image=canny_image, num_inference_steps=30, 
    negative_prompt="ugly, blurry, bad, deformed, bad anatomy", 
    generator=torch.manual_seed(42)
).images[0]

Sources

1 source
Hugging FacePrincipalVersion dc4db28f9a1aa22cd90cc6b81eaab27656647d16
huggingface.co/thepowerfuldeez/sd21-controlnet-canny/tree/dc4db28f9a1aa22cd90cc6b81eaab27656647d16

Vérifié 6 oct.

Artefacts du modèle

1 artefact

diffusion_pytorch_model.bin

bin · 695 MB · SHA-256 698bfe6ee0b0…a35d · Hugging Face

Download file

Extraits de sources

3 extraits

--- license: openrail --- Converted Canny SD 2.1-base model from https://huggingface.co/thibaud/controlnet-sd21/ to diffusers format. Saved only ControlNet weights Usage: ``` from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, DEISMultistepScheduler import cv2 from PIL import Image import numpy as np pipe = StableDiffusionControlNetPipeline.from_pretrained( "stabilityai/stable-diffusion-2-1-base", safety_checker=None, # revision='fp16', # torch_dtype=torch.float16, controlnet=ControlNetModel.from_pretrained("thepowefuldeez/sd21-controlnet-canny") ).to('cuda') pipe.scheduler = DEISMultistepScheduler.from_config(pipe.scheduler.config) image = np.array(Image.open("10.png")) low_threshold = 100 high_threshold = 200 image = cv2.Canny(image, low_threshold, high_threshold) image = image[:, :, None] image = np.concatenate([image, image, image], axis=2) canny_image = Image.fromarray(image) im = pipe( "beautiful woman", image=canny_image, num_inference_steps=30, negative_prompt="ugly, blurry, bad, deformed, bad anatomy", generator=torch.manual_seed(42) ).images[0] ```

Source context: 18 downloads · 7 likes · Library diffusers · Repo thepowerfuldeez/sd21-controlnet-canny

Source context: 8 downloads · 7 likes · Library diffusers · Repo thepowerfuldeez/sd21-controlnet-canny