Docty commited on
Commit
04c5c6d
·
verified ·
1 Parent(s): 46d29fb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -2
README.md CHANGED
@@ -20,8 +20,33 @@ should probably proofread and complete it, then remove this comment. -->
20
 
21
  # ControlNet for cloth- Docty/cloth_controlnet
22
 
23
- These are LoRA adaption weights for stable-diffusion-v1-5/stable-diffusion-v1-5. The weights were trained on a realistic photo of poiuyt pipes using [DreamBooth](https://dreambooth.github.io/). You can find some example images in the following.
24
 
25
  ![img_0](./image_control.png)
26
  ![img_1](./images_0.png)
27
- ![img_2](./images_1.png)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  # ControlNet for cloth- Docty/cloth_controlnet
22
 
23
+ These are ControlNet for stable-diffusion-v1-5/stable-diffusion-v1-5. You can find some example images in the following.
24
 
25
  ![img_0](./image_control.png)
26
  ![img_1](./images_0.png)
27
+ ![img_2](./images_1.png)
28
+
29
+ ```python
30
+ from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
31
+ from diffusers.utils import load_image
32
+ import torch
33
+
34
+ base_model_path = "stable-diffusion-v1-5/stable-diffusion-v1-5"
35
+ controlnet_path = "Docty/cloth_controlnet"
36
+
37
+ controlnet = ControlNetModel.from_pretrained(controlnet_path, torch_dtype=torch.float16)
38
+ pipe = StableDiffusionControlNetPipeline.from_pretrained(
39
+ base_model_path, controlnet=controlnet, torch_dtype=torch.float16
40
+ )
41
+
42
+ control_image = load_image("/kaggle/input/netcontroldataset/netcontrol/cond1.jpg")
43
+ prompt = "a professional studio photograph of an attractive model wearing a teal top with lace detail"
44
+
45
+ # generate image
46
+ #generator = torch.manual_seed(0)
47
+ image = pipe(
48
+ prompt, num_inference_steps=20, image=control_image
49
+ ).images[0]
50
+ image
51
+
52
+ ```