xueyao commited on
Commit
685d3ca
·
1 Parent(s): 9d334ed

first commit

Browse files
Files changed (4) hide show
  1. README.md +72 -0
  2. config.json +33 -0
  3. depth.png +0 -0
  4. diffusion_pytorch_model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: stabilityai-ai-community
4
+ license_link: LICENSE.md
5
+ language:
6
+ - en
7
+ base_model:
8
+ - stabilityai/stable-diffusion-3.5-medium
9
+ pipeline_tag: text-to-image
10
+ ---
11
+
12
+ <div align="center">
13
+ **TensorArt Stable Diffusion 3.5 Medium ControlNet Depth**
14
+
15
+ # <img src="./assets/showcase.png"/>
16
+ </div>
17
+
18
+ # With SD3.5M
19
+ ```python
20
+ import torch
21
+ from diffusers import StableDiffusion3ControlNetPipeline
22
+ from diffusers.models import SD3ControlNetModel
23
+ from diffusers.utils import load_image
24
+
25
+ controlnet = SD3ControlNetModel.from_pretrained("tensorart/SD3.5M-Controlnet-Depth")
26
+ pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
27
+ "stabilityai/stable-diffusion-3-medium",
28
+ controlnet=controlnet
29
+ )
30
+ pipe.to("cuda", torch.float16)
31
+
32
+ control_image = load_image("https://huggingface.co/tensorart/SD3.5M-Controlnet-Depth/resolve/main/images/depth.png")
33
+ prompt = "A cyberpunk man"
34
+ negative_prompt = "low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, monochrome"
35
+
36
+ image = pipe(
37
+ prompt,
38
+ num_inference_steps=30,
39
+ negative_prompt=negative_prompt,
40
+ control_image=control_image,
41
+ guidance_scale=4.5,
42
+ ).images[0]
43
+ image.save('image.jpg')
44
+ ```
45
+
46
+ # With TensorArt's SD3.5M Turbo
47
+ ```python
48
+ import torch
49
+ from diffusers import StableDiffusion3ControlNetPipeline
50
+ from diffusers.models import SD3ControlNetModel
51
+ from diffusers.utils import load_image
52
+
53
+ controlnet = SD3ControlNetModel.from_pretrained("tensorart/SD3.5M-Controlnet-Depth")
54
+ pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
55
+ "stabilityai/stable-diffusion-3-medium",
56
+ controlnet=controlnet
57
+ )
58
+ pipe.to("cuda", torch.float16)
59
+
60
+ control_image = load_image("https://huggingface.co/tensorart/SD3.5M-Controlnet-Depth/resolve/main/images/depth.png")
61
+ prompt = "A cyberpunk man"
62
+ negative_prompt = "low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, monochrome"
63
+
64
+ image = pipe(
65
+ prompt,
66
+ num_inference_steps=8,
67
+ negative_prompt=negative_prompt,
68
+ control_image=control_image,
69
+ guidance_scale=1.5
70
+ ).images[0]
71
+ image.save('image.jpg')
72
+ ```
config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "SD3ControlNetModel",
3
+ "_diffusers_version": "0.32.0.dev0",
4
+ "_name_or_path": "stabilityai/stable-diffusion-3.5-medium",
5
+ "attention_head_dim": 64,
6
+ "caption_projection_dim": 1536,
7
+ "dual_attention_layers": [
8
+ 0,
9
+ 1,
10
+ 2,
11
+ 3,
12
+ 4,
13
+ 5,
14
+ 6,
15
+ 7,
16
+ 8,
17
+ 9,
18
+ 10,
19
+ 11,
20
+ 12
21
+ ],
22
+ "extra_conditioning_channels": 0,
23
+ "in_channels": 16,
24
+ "joint_attention_dim": 4096,
25
+ "num_attention_heads": 24,
26
+ "num_layers": 23,
27
+ "out_channels": 16,
28
+ "patch_size": 2,
29
+ "pooled_projection_dim": 2048,
30
+ "pos_embed_max_size": 384,
31
+ "qk_norm": "rms_norm",
32
+ "sample_size": 128
33
+ }
depth.png ADDED
diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f768adb86fa5585afd4fc9a301317d703c69921630278e1f8095364c6f71a306
3
+ size 4930003400