-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Hi, thanks for your great contributions to the community! I’ve been using DiffSynth for a long time.
After upgrading to v2.0.0, I ran into an issue during inference and I suspect there may be a bug in config.py?
I have downloaded the model weights locally and tried to load the model like this:
pipe = FluxImagePipeline.from_pretrained(
torch_dtype=torch.bfloat16,
device="cuda",
model_configs=[
ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="flux1-kontext-dev.safetensors", local_model_path=args.model_path, skip_download=True),
ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="text_encoder/model.safetensors", local_model_path=args.model_path, skip_download=True),
ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="text_encoder_2/model*.safetensors", local_model_path=args.model_path, skip_download=True),
ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="ae.safetensors", local_model_path=args.model_path, skip_download=True),
],
)
However, I got an error because self.path doesn’t seem to be passed correctly (it looks like the local path is not being applied as expected when skip_download=True). Could you please take a look, or let me know if I’m missing something? If this is indeed a bug, I’d be happy to submit a PR to fix it :).
The traceback was showed below:
Loading models from: null
Traceback (most recent call last):
File "xxx/FLUX.1-Kontext-dev-inference.py", line 66, in <module>
pipe = FluxImagePipeline.from_pretrained(
File "xxx/diffsynth/pipelines/flux_image.py", line 130, in from_pretrained
model_pool = pipe.download_and_load_models(model_configs, vram_limit)
File "xxx/diffsynth/diffusion/base_pipeline.py", line 289, in download_and_load_models
model_pool.auto_load_model(
File "xxx/diffsynth/models/model_loader.py", line 66, in auto_load_model
model_hash = hash_model_file(path)
File "xxx/diffsynth/core/loader/file.py", line 118, in hash_model_file
keys_dict = load_keys_dict(path)
File "xxx/diffsynth/core/loader/file.py", line 71, in load_keys_dict
if file_path.endswith(".safetensors"):
AttributeError: 'NoneType' object has no attribute 'endswith'
Metadata
Metadata
Assignees
Labels
No labels