Update README.md
Browse files
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
|
24 |
|
25 |

|
26 |

|
27 |
-

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |

|
26 |

|
27 |
+

|
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 |
+
```
|