wanghaofan commited on
Commit
3f341fe
1 Parent(s): f2d1364

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +44 -43
README.md CHANGED
@@ -1,43 +1,44 @@
1
- ---
2
- license: apache-2.0
3
- ---
4
-
5
- # SD3-ControlNet-Depth
6
-
7
- <img src="./assets/teaser.png"/>
8
-
9
- # Demo
10
- ```python
11
- import torch
12
- from diffusers import StableDiffusion3ControlNetPipeline
13
- from diffusers.models import SD3ControlNetModel, SD3MultiControlNetModel
14
- from diffusers.utils import load_image
15
-
16
- # load pipeline
17
- controlnet = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Depth")
18
- pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
19
- "stabilityai/stable-diffusion-3-medium-diffusers",
20
- controlnet=controlnet
21
- )
22
- pipe.to("cuda", torch.float16)
23
-
24
- # config
25
- control_image = load_image("https://huggingface.co/InstantX/SD3-Controlnet-Depth/resolve/main/images/depth.jpeg")
26
- prompt = "a panda cub, captured in a close-up, in forest, is perched on a tree trunk. good composition, Photography, the cub's ears, a fluffy black, are tucked behind its head, adding a touch of whimsy to its appearance. a lush tapestry of green leaves in the background. depth of field, National Geographic"
27
- n_prompt = "bad hands, blurry, NSFW, nude, naked, porn, ugly, bad quality, worst quality"
28
-
29
- # to reproduce result in our example
30
- generator = torch.Generator(device="cpu").manual_seed(4000)
31
- image = pipe(
32
- prompt,
33
- negative_prompt=n_prompt,
34
- control_image=control_image,
35
- controlnet_conditioning_scale=0.5,
36
- guidance_scale=7.0,
37
- generator=generator
38
- ).images[0]
39
- image.save('image.jpg')
40
- ```
41
-
42
- # Limitation
43
- Due to the fact that only 1024*1024 pixel resolution was used during the training phase, the inference performs best at this size, with other sizes yielding suboptimal results.
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: diffusers
4
+ ---
5
+
6
+ # SD3-ControlNet-Depth
7
+
8
+ <img src="./assets/teaser.png"/>
9
+
10
+ # Demo
11
+ ```python
12
+ import torch
13
+ from diffusers import StableDiffusion3ControlNetPipeline
14
+ from diffusers.models import SD3ControlNetModel, SD3MultiControlNetModel
15
+ from diffusers.utils import load_image
16
+
17
+ # load pipeline
18
+ controlnet = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Depth")
19
+ pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
20
+ "stabilityai/stable-diffusion-3-medium-diffusers",
21
+ controlnet=controlnet
22
+ )
23
+ pipe.to("cuda", torch.float16)
24
+
25
+ # config
26
+ control_image = load_image("https://huggingface.co/InstantX/SD3-Controlnet-Depth/resolve/main/images/depth.jpeg")
27
+ prompt = "a panda cub, captured in a close-up, in forest, is perched on a tree trunk. good composition, Photography, the cub's ears, a fluffy black, are tucked behind its head, adding a touch of whimsy to its appearance. a lush tapestry of green leaves in the background. depth of field, National Geographic"
28
+ n_prompt = "bad hands, blurry, NSFW, nude, naked, porn, ugly, bad quality, worst quality"
29
+
30
+ # to reproduce result in our example
31
+ generator = torch.Generator(device="cpu").manual_seed(4000)
32
+ image = pipe(
33
+ prompt,
34
+ negative_prompt=n_prompt,
35
+ control_image=control_image,
36
+ controlnet_conditioning_scale=0.5,
37
+ guidance_scale=7.0,
38
+ generator=generator
39
+ ).images[0]
40
+ image.save('image.jpg')
41
+ ```
42
+
43
+ # Limitation
44
+ Due to the fact that only 1024*1024 pixel resolution was used during the training phase, the inference performs best at this size, with other sizes yielding suboptimal results.