xueyao
commited on
Commit
·
4c882f2
1
Parent(s):
8c1bc0e
first commit
Browse files- README.md +78 -0
- config.json +33 -0
- diffusion_pytorch_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
|
| 14 |
+
**TensorArt Stable Diffusion 3.5 Medium ControlNet Canny**
|
| 15 |
+
|
| 16 |
+
<img src="./asset/demo.png"/>
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
# With SD3.5M
|
| 20 |
+
```python
|
| 21 |
+
import torch
|
| 22 |
+
from diffusers import StableDiffusion3ControlNetPipeline
|
| 23 |
+
from diffusers import SD3ControlNetModel
|
| 24 |
+
from diffusers.utils import load_image
|
| 25 |
+
|
| 26 |
+
controlnet = SD3ControlNetModel.from_pretrained("tensorart/SD3.5M-Controlnet-Canny")
|
| 27 |
+
pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
|
| 28 |
+
"stabilityai/stable-diffusion-3.5-medium",
|
| 29 |
+
controlnet=controlnet
|
| 30 |
+
)
|
| 31 |
+
pipe.to("cuda", torch.float16)
|
| 32 |
+
|
| 33 |
+
control_image = load_image("https://huggingface.co/tensorart/SD3.5M-Controlnet-Canny/resolve/main/asset/canny.png")
|
| 34 |
+
prompt = "An eye"
|
| 35 |
+
negative_prompt = "low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, monochrome"
|
| 36 |
+
|
| 37 |
+
image = pipe(
|
| 38 |
+
prompt,
|
| 39 |
+
num_inference_steps=30,
|
| 40 |
+
negative_prompt=negative_prompt,
|
| 41 |
+
control_image=control_image,
|
| 42 |
+
guidance_scale=4.5,
|
| 43 |
+
).images[0]
|
| 44 |
+
image.save('image.jpg')
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
# With TensorArt's SD3.5M Turbo
|
| 49 |
+
```python
|
| 50 |
+
import torch
|
| 51 |
+
from diffusers import StableDiffusion3ControlNetPipeline
|
| 52 |
+
from diffusers import SD3ControlNetModel
|
| 53 |
+
from diffusers.utils import load_image
|
| 54 |
+
|
| 55 |
+
controlnet = SD3ControlNetModel.from_pretrained("tensorart/SD3.5M-Controlnet-Canny")
|
| 56 |
+
pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
|
| 57 |
+
"tensorart/stable-diffusion-3.5-medium-turbo",
|
| 58 |
+
controlnet=controlnet
|
| 59 |
+
)
|
| 60 |
+
pipe.to("cuda", torch.float16)
|
| 61 |
+
|
| 62 |
+
control_image = load_image("https://huggingface.co/tensorart/SD3.5M-Controlnet-Canny/resolve/main/asset/canny.png")
|
| 63 |
+
prompt = "An eye"
|
| 64 |
+
negative_prompt = "low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, monochrome"
|
| 65 |
+
|
| 66 |
+
image = pipe(
|
| 67 |
+
prompt,
|
| 68 |
+
num_inference_steps=8,
|
| 69 |
+
negative_prompt=negative_prompt,
|
| 70 |
+
control_image=control_image,
|
| 71 |
+
guidance_scale=1.5
|
| 72 |
+
).images[0]
|
| 73 |
+
image.save('image.jpg')
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
## Contact
|
| 77 |
+
* Website: https://tensor.art https://tusiart.com
|
| 78 |
+
* Developed by: TensorArt
|
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 |
+
}
|
diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:60f6eeaf265ba3336705ecd6dcd8170985fa577bc5f04fd7649aca06f139634a
|
| 3 |
+
size 4930003400
|