Load sd3 from local path

#195
by Walnuttt - opened

Hello, how can I use "StableDiffusion3Pipeline.from_pretrained" with a local dir such as /home/user/moder/sd3
Generally, in sdxl or other sd models, there are "scheduler","tokenizer","config.json"... in files. But I can't find them in sd3 files. There are only checkpoints and text encoder moderl.
I think because of the security problem, developers didn't pull these files?
If not, please tell me how can I use pipeline without downloading from the hugging face, thanks

from diffusers import StableDiffusion3Pipeline

pipe = StableDiffusion3Pipeline.from_single_file(
"path_to_sd3_medium_incl_clips.safetensors",
torch_dtype=torch.float32,
text_encoder_3=None
)

Because i try to use "diffusers/examples/dreambooth/train_dreambooth_sd3_lora.py" to finetune sd3 (it use StableDiffusion3Pipeline.from_pretrained to load model),StableDiffusion3Pipeline.from_single_file maybe cannot work

from diffusers import StableDiffusion3Pipeline

pipe = StableDiffusion3Pipeline.from_single_file(
"path_to_sd3_medium_incl_clips.safetensors",
torch_dtype=torch.float32,
text_encoder_3=None
)

It doesn't work at all.

pipe = pipeline_class.from_pretrained(model_file_path, **pipeline_config)

where pipeline_class is StableDiffusion3Pipeline

from diffusers.pipelines import StableDiffusion3Pipeline
pipe = StableDiffusion3Pipeline.from_pretrained(model_file_path, **pipeline_config)
  • pipe is a callable instance object
  • model_file_path must exist locally, otherwise it will default to the remote path.
  • **pipeline_config is a dictionary containing key-value pair arguments

Sign up or log in to comment