Downloads · 30 days
11
27% of all-time downloads
liuch37/controlnet-sd-2-1-base-v1
controlnet-sd-2-1-base-v1 is a text-to-image model from liuch37. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as creativeml-openrail-m.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
11
27% of all-time downloads
All-time downloads
41
Public
Parameters
364M
16 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.8 GB · 73%
From the Hugging Face model README
These are controlnet weights trained on stabilityai/stable-diffusion-2-1-base with new type of conditioning.
from PIL import Image
from diffusers import (
ControlNetModel,
StableDiffusionControlNetPipeline,
UniPCMultistepScheduler,
)
checkpoint = "liuch37/controlnet-sd-2-1-base-v1"
prompt = "YOUR_FAVORITE_PROMPT"
control_image = Image.open("YOUR_SEMANTIC_IMAGE")
controlnet = ControlNetModel.from_pretrained(checkpoint, torch_dtype=torch.float32)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
"stabilityai/stable-diffusion-2-1-base", controlnet=controlnet, torch_dtype=torch.float32
)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
generator = torch.manual_seed(0)
image = pipe(prompt, num_inference_steps=30, generator=generator, image=control_image).images[0]
image.save("YOUR_OUTPUT_IMAGE")
[TODO: provide examples of latent issues and potential remediations]
Train the ControlNet with semantic maps as the condition. Cityscapes training set is used for training (https://huggingface.co/datasets/liuch37/controlnet-cityscapes). Only 2 epochs are trained for the current version.