HighCWu / control-lora-v3

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: July 31 2024
text-to-image

Introduction of control-lora-v3

Model Details of control-lora-v3

ControlLoRA Version 3 Pretrained Models Collection

This is a collections of control-lora-v3 weights trained on runwayml/stable-diffusion-v1-5 and stabilityai/stable-diffusion-xl-base-1.0 with different types of conditioning. You can find some example images below.

Stable Diffusion
Canny
OpenPose + Segmentation

This is experimental, and it doesn't work well.

Depth
Normal map
OpenPose
Segmentation
Tile
Stable Diffusion XL
Canny
Intended uses & limitations
How to use

First clone the control-lora-v3 and cd in the directory:

git clone https://github.com/HighCWu/control-lora-v3
cd control-lora-v3

Then run the python code。

For stable diffusion, use:

# !pip install opencv-python transformers accelerate
from diffusers import UniPCMultistepScheduler
from diffusers.utils import load_image
from model import UNet2DConditionModelEx
from pipeline import StableDiffusionControlLoraV3Pipeline
import numpy as np
import torch

import cv2
from PIL import Image

# download an image
image = load_image(
    "https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png"
)
image = np.array(image)

# get canny image
image = cv2.Canny(image, 100, 200)
image = image[:, :, None]
image = np.concatenate([image, image, image], axis=2)
canny_image = Image.fromarray(image)

# load stable diffusion v1-5 and control-lora-v3 
unet: UNet2DConditionModelEx = UNet2DConditionModelEx.from_pretrained(
    "runwayml/stable-diffusion-v1-5", subfolder="unet", torch_dtype=torch.float16
)
unet = unet.add_extra_conditions(["canny"])
pipe = StableDiffusionControlLoraV3Pipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5", unet=unet, torch_dtype=torch.float16
)
# load attention processors
# pipe.load_lora_weights("HighCWu/sd-control-lora-v3-canny")
pipe.load_lora_weights("HighCWu/control-lora-v3", subfolder="sd-control-lora-v3-canny-half_skip_attn-rank16-conv_in-rank64")

# speed up diffusion process with faster scheduler and memory optimization
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
# remove following line if xformers is not installed
pipe.enable_xformers_memory_efficient_attention()

pipe.enable_model_cpu_offload()

# generate image
generator = torch.manual_seed(0)
image = pipe(
    "futuristic-looking woman", num_inference_steps=20, generator=generator, image=canny_image
).images[0]
image.show()

For stable diffusion xl, use:

# !pip install opencv-python transformers accelerate
from diffusers import AutoencoderKL
from diffusers.utils import load_image
from model import UNet2DConditionModelEx
from pipeline_sdxl import StableDiffusionXLControlLoraV3Pipeline
import numpy as np
import torch

import cv2
from PIL import Image

prompt = "aerial view, a futuristic research complex in a bright foggy jungle, hard lighting"
negative_prompt = "low quality, bad quality, sketches"

# download an image
image = load_image(
    "https://hf.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/hf-logo.png"
)

# initialize the models and pipeline
unet: UNet2DConditionModelEx = UNet2DConditionModelEx.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0", subfolder="unet", torch_dtype=torch.float16
)
unet = unet.add_extra_conditions(["canny"])
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = StableDiffusionXLControlLoraV3Pipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0", unet=unet, vae=vae, torch_dtype=torch.float16
)
# load attention processors
# pipe.load_lora_weights("HighCWu/sdxl-control-lora-v3-canny")
pipe.load_lora_weights("HighCWu/control-lora-v3", subfolder="sdxl-control-lora-v3-canny-half_skip_attn-rank16-conv_in-rank64")
pipe.enable_model_cpu_offload()

# get canny image
image = np.array(image)
image = cv2.Canny(image, 100, 200)
image = image[:, :, None]
image = np.concatenate([image, image, image], axis=2)
canny_image = Image.fromarray(image)

# generate image
image = pipe(
    prompt, image=canny_image
).images[0]
image.show()
Limitations and bias

[TODO: provide examples of latent issues and potential remediations]

Training details

[TODO: describe the data used to train the model]

Runs of HighCWu control-lora-v3 on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About control-lora-v3 huggingface.co Model

More control-lora-v3 license Visit here:

https://choosealicense.com/licenses/creativeml-openrail-m

control-lora-v3 huggingface.co

control-lora-v3 huggingface.co is an AI model on huggingface.co that provides control-lora-v3's model effect (), which can be used instantly with this HighCWu control-lora-v3 model. huggingface.co supports a free trial of the control-lora-v3 model, and also provides paid use of the control-lora-v3. Support call control-lora-v3 model through api, including Node.js, Python, http.

control-lora-v3 huggingface.co Url

https://huggingface.co/HighCWu/control-lora-v3

HighCWu control-lora-v3 online free

control-lora-v3 huggingface.co is an online trial and call api platform, which integrates control-lora-v3's modeling effects, including api services, and provides a free online trial of control-lora-v3, you can try control-lora-v3 online for free by clicking the link below.

HighCWu control-lora-v3 online free url in huggingface.co:

https://huggingface.co/HighCWu/control-lora-v3

control-lora-v3 install

control-lora-v3 is an open source model from GitHub that offers a free installation service, and any user can find control-lora-v3 on GitHub to install. At the same time, huggingface.co provides the effect of control-lora-v3 install, users can directly use control-lora-v3 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

control-lora-v3 install url in huggingface.co:

https://huggingface.co/HighCWu/control-lora-v3

Url of control-lora-v3

control-lora-v3 huggingface.co Url

Provider of control-lora-v3 huggingface.co

HighCWu
ORGANIZATIONS

Other API from HighCWu

huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 10 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 25 2023