Instructions to use BiliSakura/DiT-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BiliSakura/DiT-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("BiliSakura/DiT-diffusers", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Upload folder using huggingface_hub
Browse files- DiT-XL-2-256/README.md +1 -0
- DiT-XL-2-256/pipeline.py +1 -0
- DiT-XL-2-512/README.md +1 -0
- DiT-XL-2-512/pipeline.py +1 -0
- README.md +1 -0
DiT-XL-2-256/README.md
CHANGED
|
@@ -27,6 +27,7 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 27 |
str(model_dir),
|
| 28 |
local_files_only=True,
|
| 29 |
custom_pipeline=str(model_dir / "pipeline.py"),
|
|
|
|
| 30 |
torch_dtype=torch.float32,
|
| 31 |
).to("cuda" if torch.cuda.is_available() else "cpu")
|
| 32 |
|
|
|
|
| 27 |
str(model_dir),
|
| 28 |
local_files_only=True,
|
| 29 |
custom_pipeline=str(model_dir / "pipeline.py"),
|
| 30 |
+
trust_remote_code=True,
|
| 31 |
torch_dtype=torch.float32,
|
| 32 |
).to("cuda" if torch.cuda.is_available() else "cpu")
|
| 33 |
|
DiT-XL-2-256/pipeline.py
CHANGED
|
@@ -35,6 +35,7 @@ EXAMPLE_DOC_STRING = """
|
|
| 35 |
... str(model_dir),
|
| 36 |
... local_files_only=True,
|
| 37 |
... custom_pipeline=str(model_dir / "pipeline.py"),
|
|
|
|
| 38 |
... torch_dtype=torch.float16,
|
| 39 |
... )
|
| 40 |
>>> pipe = pipe.to("cuda")
|
|
|
|
| 35 |
... str(model_dir),
|
| 36 |
... local_files_only=True,
|
| 37 |
... custom_pipeline=str(model_dir / "pipeline.py"),
|
| 38 |
+
... trust_remote_code=True,
|
| 39 |
... torch_dtype=torch.float16,
|
| 40 |
... )
|
| 41 |
>>> pipe = pipe.to("cuda")
|
DiT-XL-2-512/README.md
CHANGED
|
@@ -58,6 +58,7 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 58 |
str(model_dir),
|
| 59 |
local_files_only=True,
|
| 60 |
custom_pipeline=str(model_dir / "pipeline.py"),
|
|
|
|
| 61 |
torch_dtype=torch.float32,
|
| 62 |
).to("cuda")
|
| 63 |
|
|
|
|
| 58 |
str(model_dir),
|
| 59 |
local_files_only=True,
|
| 60 |
custom_pipeline=str(model_dir / "pipeline.py"),
|
| 61 |
+
trust_remote_code=True,
|
| 62 |
torch_dtype=torch.float32,
|
| 63 |
).to("cuda")
|
| 64 |
|
DiT-XL-2-512/pipeline.py
CHANGED
|
@@ -35,6 +35,7 @@ EXAMPLE_DOC_STRING = """
|
|
| 35 |
... str(model_dir),
|
| 36 |
... local_files_only=True,
|
| 37 |
... custom_pipeline=str(model_dir / "pipeline.py"),
|
|
|
|
| 38 |
... torch_dtype=torch.float16,
|
| 39 |
... )
|
| 40 |
>>> pipe = pipe.to("cuda")
|
|
|
|
| 35 |
... str(model_dir),
|
| 36 |
... local_files_only=True,
|
| 37 |
... custom_pipeline=str(model_dir / "pipeline.py"),
|
| 38 |
+
... trust_remote_code=True,
|
| 39 |
... torch_dtype=torch.float16,
|
| 40 |
... )
|
| 41 |
>>> pipe = pipe.to("cuda")
|
README.md
CHANGED
|
@@ -60,6 +60,7 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 60 |
str(model_dir),
|
| 61 |
local_files_only=True,
|
| 62 |
custom_pipeline=str(model_dir / "pipeline.py"),
|
|
|
|
| 63 |
torch_dtype=torch.bfloat16,
|
| 64 |
).to("cuda")
|
| 65 |
generator = torch.Generator(device="cuda").manual_seed(0)
|
|
|
|
| 60 |
str(model_dir),
|
| 61 |
local_files_only=True,
|
| 62 |
custom_pipeline=str(model_dir / "pipeline.py"),
|
| 63 |
+
trust_remote_code=True,
|
| 64 |
torch_dtype=torch.bfloat16,
|
| 65 |
).to("cuda")
|
| 66 |
generator = torch.Generator(device="cuda").manual_seed(0)
|