Update README.md
Browse files
README.md
CHANGED
@@ -8,7 +8,7 @@ tags:
|
|
8 |
- image-to-image
|
9 |
- diffusers
|
10 |
- controlnet
|
11 |
-
-
|
12 |
---
|
13 |
|
14 |
# ControlLoRA - Face Landmarks Version
|
@@ -37,7 +37,7 @@ from PIL import Image
|
|
37 |
from diffusers import StableDiffusionControlNetPipeline, UNet2DConditionModel, UniPCMultistepScheduler
|
38 |
import torch
|
39 |
from PIL import Image
|
40 |
-
from models.
|
41 |
|
42 |
image = Image.open('<Your Conditioning Image Path>')
|
43 |
|
@@ -46,13 +46,13 @@ base_model = "runwayml/stable-diffusion-v1-5"
|
|
46 |
unet = UNet2DConditionModel.from_pretrained(
|
47 |
base_model, subfolder="unet", torch_dtype=torch.float16
|
48 |
)
|
49 |
-
|
50 |
-
"HighCWu/sd-
|
51 |
)
|
52 |
-
|
53 |
|
54 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
55 |
-
base_model, unet=unet, controlnet=
|
56 |
)
|
57 |
|
58 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
|
|
8 |
- image-to-image
|
9 |
- diffusers
|
10 |
- controlnet
|
11 |
+
- control-lora
|
12 |
---
|
13 |
|
14 |
# ControlLoRA - Face Landmarks Version
|
|
|
37 |
from diffusers import StableDiffusionControlNetPipeline, UNet2DConditionModel, UniPCMultistepScheduler
|
38 |
import torch
|
39 |
from PIL import Image
|
40 |
+
from models.control_lora import ControlLoRAModel
|
41 |
|
42 |
image = Image.open('<Your Conditioning Image Path>')
|
43 |
|
|
|
46 |
unet = UNet2DConditionModel.from_pretrained(
|
47 |
base_model, subfolder="unet", torch_dtype=torch.float16
|
48 |
)
|
49 |
+
control_lora = ControlLoRAModel.from_pretrained(
|
50 |
+
"HighCWu/sd-control-lora-face-landmarks", torch_dtype=torch.float16
|
51 |
)
|
52 |
+
control_lora.tie_weights(unet)
|
53 |
|
54 |
pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
55 |
+
base_model, unet=unet, controlnet=control_lora, safety_checker=None, torch_dtype=torch.float16
|
56 |
)
|
57 |
|
58 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|