Skip to content

Commit 27e92c5

Browse files
committed
feedback
1 parent 4434750 commit 27e92c5

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

docs/source/en/using-diffusers/other-formats.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ from diffusers import FluxPipeline, FluxTransformer2DModel
5959
transformer = FluxTransformer2DModel.from_single_file(
6060
"https://huggingface.co/Kijai/flux-fp8/blob/main/flux1-dev-fp8.safetensors", torch_dtype=torch.bfloat16
6161
)
62-
pipeline = FluxPipeline.from_single_file(
62+
pipeline = FluxPipeline.from_pretrained(
6363
"black-forest-labs/FLUX.1-dev",
6464
transformer=transformer,
6565
torch_dtype=torch.bfloat16,
@@ -81,17 +81,6 @@ ckpt_path = "https://huggingface.co/segmind/SSD-1B/blob/main/SSD-1B.safetensors"
8181
pipeline = StableDiffusionXLPipeline.from_single_file(ckpt_path, config="segmind/SSD-1B")
8282
```
8383

84-
You could also load a config file not stored on the Hub by passing a local path or URL of the config file to the `original_config` argument.
85-
86-
```py
87-
from diffusers import StableDiffusionXLPipeline
88-
89-
ckpt_path = "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0_0.9vae.safetensors"
90-
original_config = "https://raw.githubusercontent.com/Stability-AI/generative-models/main/configs/inference/sd_xl_base.yaml"
91-
92-
pipeline = StableDiffusionXLPipeline.from_single_file(ckpt_path, original_config=original_config)
93-
```
94-
9584
Diffusers attempts to infer the pipeline components based on the signature types of the pipeline class when using `original_config` with `local_files_only=True`. It won't download the config files from a Hub repository to avoid backward breaking changes when you can't connect to the internet. This method isn't as reliable as providing a path to a local model with the `config` argument and may lead to errors. You should run the pipeline with `local_files_only=False` to download the config files to the local cache to avoid errors.
9685

9786
Override default configs by passing the arguments directly to [`~loaders.FromSingleFileMixin.from_single_file`]. The examples below demonstrate how to override the configs in a pipeline or model.
@@ -139,7 +128,7 @@ pipeline = StableDiffusionXLPipeline.from_single_file(
139128

140129
### Symlink
141130

142-
If you're working with a file system that does not support symlinking, download the checkpoint file to a local directory first. Disable symlinking with `local_dir_use_symlink=False` in [`~huggingface_hub.snapshot_download`] and [`~huggingface_hub.hf_hub_download`].
131+
If you're working with a file system that does not support symlinking, download the checkpoint file to a local directory first with the `local_dir` parameter. Using the `local_dir` parameter automatically disables symlinks.
143132

144133
```py
145134
from huggingface_hub import hf_hub_download, snapshot_download
@@ -149,14 +138,12 @@ my_local_checkpoint_path = hf_hub_download(
149138
repo_id="segmind/SSD-1B",
150139
filename="SSD-1B.safetensors"
151140
local_dir="my_local_checkpoints",
152-
local_dir_use_symlinks=False
153141
)
154142
print("My local checkpoint: ", my_local_checkpoint_path)
155143

156144
my_local_config_path = snapshot_download(
157145
repo_id="segmind/SSD-1B",
158146
allow_patterns=["*.json", "**/*.json", "*.txt", "**/*.txt"]
159-
local_dir_use_symlinks=False,
160147
)
161148
print("My local config: ", my_local_config_path)
162149
```

0 commit comments

Comments
 (0)