vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.7k stars 423 forks source link

[Issue]: FLUX. ERROR Diffusers Failed loading model: #3409

Closed Yp-pro closed 2 months ago

Yp-pro commented 2 months ago

Issue Description

Hello. I'm trying to use Flux. Could you please help me with that?

1) I opened SD.Next 2) Then Network > Reference > Black Forest Labs FLUX.1 Dev qint8

And got the following:

15:48:46-667257 ERROR Diffusers Failed loading model: models\Diffusers\models--Disty0--FLUX.1-dev-qint8\snapshots\fd65655d4d82276350aa5cd93b454a112f 4a616e Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: 'Diffusers\Disty0/FLUX.1-dev-qint8'. 15:57:20-837784 INFO Select: model="Diffusers\Disty0/FLUX.1-dev-qint8 [fd65655d4d]" 15:57:20-840778 INFO Autodetect: model="FLUX" class=FluxPipeline file="models\Diffusers\models--Disty0--FLUX.1-dev-qint8\snapshots\fd65655d4d82276350aa5cd93b45 4a112f4a616e" size=0MB

Full screenshot:

image

Full log: 15:42:17-013173 INFO Extensions: disabled=[] 15:42:17-013173 INFO Extensions: enabled=['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg'] extensions-builtin 15:42:17-013173 INFO Extensions: enabled=[] extensions 15:42:17-028844 INFO Command line args: [] 15:42:19-938825 INFO Load packages: {'torch': '2.4.1+cu124', 'diffusers': '0.30.2', 'gradio': '3.43.2'} 15:42:21-352035 INFO VRAM: Detected=8.0 GB Optimization=medvram 15:42:21-352035 INFO Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="Scaled-Dot-Product" mode=no_grad 15:42:21-398921 INFO Device: device=NVIDIA GeForce RTX 4060 Laptop GPU n=1 arch=sm_90 cap=(8, 9) cuda=12.4 cudnn=90100 driver=551.86 15:42:21-664509 INFO Available VAEs: path="models\VAE" items=0 15:42:21-664509 INFO Disabled extensions: ['sdnext-modernui'] 15:42:21-664509 INFO Available models: path="models\Stable-diffusion" items=27 time=0.00 15:42:21-805126 INFO Extension: script='extensions-builtin\Lora\scripts\lora_script.py' 15:42:21-805126 INFO LoRA networks: available=0 folders=2 15:42:22-133246 INFO Extension: script='extensions-builtin\sd-webui-agent-scheduler\scripts\task_scheduler.py' Using sqlite file: extensions-builtin\sd-webui-agent-scheduler\task_scheduler.sqlite3 15:42:22-148829 INFO UI theme: type=Standard name="black-teal" 15:42:22-695656 INFO Extension list is empty: refresh required 15:42:23-244312 INFO Local URL: http://127.0.0.1:7860/ 15:42:23-353702 INFO [AgentScheduler] Task queue is empty 15:42:23-353702 INFO [AgentScheduler] Registering APIs 15:42:23-431819 INFO Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16 context=no_grad fp16=True bf16=None optimization=Scaled-Dot-Product 15:42:23-431819 INFO Select: model="FLUX\flux_dev" 15:42:23-431819 INFO Autodetect: model="Stable Diffusion" class=StableDiffusionPipeline file="D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\models\Stable-diffusion\FLUX\flu x_dev.safetensors" size=16288MB Loading pipeline components... 67% -------------------------------- --------------- 4/6 [ 0:00:00 < -:--:-- , ? C/s ] 15:42:23-525604 ERROR Diffusers failed loading: model=D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\models\Stable-diffusion\FLUX\flu x_dev.safetensors pipeline=Autodetect/NoneType config={'low_cpu_mem_usage': True, 'torch_dtype': torch.float16, 'load_connected_pipeline': True, 'safety_checker': None, 'requires_safety_checker': False, 'local_files_only': False, 'extract_ema': False, 'config': 'configs/sd15', 'use_safetensors': True, 'cache_dir': 'C:\\Users\\BOSS\\.cache\\huggingface\\hub'} Failed to load UNet2DConditionModel. Weights for this component appear to be missing in the checkpoint. Please load the component before passing it in as an argument to `from_single_file`. unet = UNet2DConditionModel.from_pretrained('...') pipe = StableDiffusionPipeline.from_single_file(, unet=unet) 15:42:23-525604 ERROR loading model=D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\models\Stable-diffusion\FLUX\flu x_dev.safetensors pipeline=Autodetect/NoneType: SingleFileComponentError ┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐ │ D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\venv\Lib\site-packages\diffusers\loaders\single_file.py:495 │ │ │ │ 494 │ │ │ │ try: │ │ > 495 │ │ │ │ │ loaded_sub_model = load_single_file_sub_model( │ │ 496 │ │ │ │ │ │ library_name=library_name, │ │ │ │ D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\venv\Lib\site-packages\diffusers\loaders\single_file.py:102 │ │ │ │ 101 │ │ │ │ > 102 │ │ loaded_sub_model = load_method( │ │ 103 │ │ │ pretrained_model_link_or_path_or_dict=checkpoint, │ │ │ │ D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\venv\Lib\site-packages\huggingface_hub\utils\_validators.py │ │ │ │ 113 │ │ │ │ > 114 │ │ return fn(*args, **kwargs) │ │ 115 │ │ │ │ D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\venv\Lib\site-packages\diffusers\loaders\single_file_model. │ │ │ │ 289 │ │ if not diffusers_format_checkpoint: │ │ > 290 │ │ │ raise SingleFileComponentError( │ │ 291 │ │ │ │ f"Failed to load {mapping_class_name}. Weights for this component appear to be missing in the │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ SingleFileComponentError: Failed to load UNet2DConditionModel. Weights for this component appear to be missing in the checkpoint. During handling of the above exception, another exception occurred: ┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐ │ D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\modules\sd_models.py:1222 in load_diffuser │ │ │ │ 1221 │ │ │ │ │ │ sd_hijack_accelerate.restore_accelerate() │ │ > 1222 │ │ │ │ │ sd_model = pipeline.from_single_file(checkpoint_info.path, **diffusers_load_config) │ │ 1223 │ │ │ │ │ # sd_model = patch_diffuser_config(sd_model, checkpoint_info.path) │ │ │ │ D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\venv\Lib\site-packages\huggingface_hub\utils\_validators.py │ │ │ │ 113 │ │ │ │ > 114 │ │ return fn(*args, **kwargs) │ │ 115 │ │ │ │ D:\Soft\Art-Design\AI\StableDiffusion\SD_Next\automatic\venv\Lib\site-packages\diffusers\loaders\single_file.py:510 │ │ │ │ 509 │ │ │ │ except SingleFileComponentError as e: │ │ > 510 │ │ │ │ │ raise SingleFileComponentError( │ │ 511 │ │ │ │ │ │ ( │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ SingleFileComponentError: Failed to load UNet2DConditionModel. Weights for this component appear to be missing in the checkpoint. Please load the component before passing it in as an argument to `from_single_file`. unet = UNet2DConditionModel.from_pretrained('...') pipe = StableDiffusionPipeline.from_single_file(, unet=unet) 15:42:23-681796 INFO Startup time: 6.65 torch=2.13 gradio=0.58 diffusers=0.20 libraries=1.69 extensions=0.34 face-restore=0.13 ui-en=0.09 ui-control=0.08 ui-models=0.12 ui-settings=0.14 ui-extensions=0.33 ui-defaults=0.15 launch=0.09 app-started=0.11 checkpoint=0.27 15:42:44-318828 INFO MOTD: N/A 15:42:45-466964 INFO Browser session: user=None client=127.0.0.1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Fetching 29 files: 0%| | 0/29 [00:00
vladmandic commented 2 months ago

this has been fixed on dev branch - you can either switch branch or wait for service release which will be soon.