Skip to content

Commit 6bf67e7

Browse files
committed
Change the default model to the BF16 one for more stable training and output
1 parent 459628c commit 6bf67e7

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docs/source/en/api/models/sana_transformer2d.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The model can be loaded with the following code snippet.
2222
```python
2323
from diffusers import SanaTransformer2DModel
2424

25-
transformer = SanaTransformer2DModel.from_pretrained("Efficient-Large-Model/Sana_1600M_1024px_diffusers", subfolder="transformer", torch_dtype=torch.float16)
25+
transformer = SanaTransformer2DModel.from_pretrained("Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers", subfolder="transformer", torch_dtype=torch.bfloat16)
2626
```
2727

2828
## SanaTransformer2DModel

docs/source/en/api/pipelines/sana.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Available models:
3232

3333
| Model | Recommended dtype |
3434
|:-----:|:-----------------:|
35+
| [`Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers`](https://huggingface.co/Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers) | `torch.bfloat16` |
3536
| [`Efficient-Large-Model/Sana_1600M_1024px_diffusers`](https://huggingface.co/Efficient-Large-Model/Sana_1600M_1024px_diffusers) | `torch.float16` |
3637
| [`Efficient-Large-Model/Sana_1600M_1024px_MultiLing_diffusers`](https://huggingface.co/Efficient-Large-Model/Sana_1600M_1024px_MultiLing_diffusers) | `torch.float16` |
37-
| [`Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers`](https://huggingface.co/Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers) | `torch.bfloat16` |
3838
| [`Efficient-Large-Model/Sana_1600M_512px_diffusers`](https://huggingface.co/Efficient-Large-Model/Sana_1600M_512px_diffusers) | `torch.float16` |
3939
| [`Efficient-Large-Model/Sana_1600M_512px_MultiLing_diffusers`](https://huggingface.co/Efficient-Large-Model/Sana_1600M_512px_MultiLing_diffusers) | `torch.float16` |
4040
| [`Efficient-Large-Model/Sana_600M_1024px_diffusers`](https://huggingface.co/Efficient-Large-Model/Sana_600M_1024px_diffusers) | `torch.float16` |

src/diffusers/pipelines/pag/pipeline_pag_sana.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@
5959
>>> from diffusers import SanaPAGPipeline
6060
6161
>>> pipe = SanaPAGPipeline.from_pretrained(
62-
... "Efficient-Large-Model/Sana_1600M_1024px_diffusers",
62+
... "Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers",
6363
... pag_applied_layers=["transformer_blocks.8"],
6464
... torch_dtype=torch.float32,
6565
... )
6666
>>> pipe.to("cuda")
6767
>>> pipe.text_encoder.to(torch.bfloat16)
68-
>>> pipe.transformer = pipe.transformer.to(torch.float16)
68+
>>> pipe.transformer = pipe.transformer.to(torch.bfloat16)
6969
7070
>>> image = pipe(prompt='a cyberpunk cat with a neon sign that says "Sana"')[0]
7171
>>> image[0].save("output.png")

src/diffusers/pipelines/sana/pipeline_sana.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@
6262
>>> from diffusers import SanaPipeline
6363
6464
>>> pipe = SanaPipeline.from_pretrained(
65-
... "Efficient-Large-Model/Sana_1600M_1024px_diffusers", torch_dtype=torch.float32
65+
... "Efficient-Large-Model/Sana_1600M_1024px_BF16_diffusers", torch_dtype=torch.float32
6666
... )
6767
>>> pipe.to("cuda")
6868
>>> pipe.text_encoder.to(torch.bfloat16)
69-
>>> pipe.transformer = pipe.transformer.to(torch.float16)
69+
>>> pipe.transformer = pipe.transformer.to(torch.bfloat16)
7070
7171
>>> image = pipe(prompt='a cyberpunk cat with a neon sign that says "Sana"')[0]
7272
>>> image[0].save("output.png")

0 commit comments

Comments
 (0)