TRAINING Error running job: black-forest-labs/FLUX.1-dev

#106
by mato22 - opened

after trying everything i could find.. still no success... please help!
i tried to have the .env file in all the right places and rerecreated the token multiple times i always get this
Screenshot 2024-08-28 002504.png
Screenshot 2024-08-28 002644.png
Screenshot 2024-08-28 003143.png
Screenshot 2024-08-28 003243.png
Screenshot 2024-08-28 003349.png

(venv) C:\COMFY\ComfyUI_windows_portable\ComfyUI\ai-toolkit>python run.py train_lora_flux_24gb2.yml
Running 1 job
C:\Users\admin\ai-toolkit\venv\Lib\site-packages\controlnet_aux\segment_anything\modeling\tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_5m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_5m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
return register_model(fn_wrapper)
C:\Users\admin\ai-toolkit\venv\Lib\site-packages\controlnet_aux\segment_anything\modeling\tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_11m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_11m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
return register_model(fn_wrapper)
C:\Users\admin\ai-toolkit\venv\Lib\site-packages\controlnet_aux\segment_anything\modeling\tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
return register_model(fn_wrapper)
C:\Users\admin\ai-toolkit\venv\Lib\site-packages\controlnet_aux\segment_anything\modeling\tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_384 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_384. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
return register_model(fn_wrapper)
C:\Users\admin\ai-toolkit\venv\Lib\site-packages\controlnet_aux\segment_anything\modeling\tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_512 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_512. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
return register_model(fn_wrapper)
{
"type": "sd_trainer",
"training_folder": "output",
"device": "cuda:0",
"network": {
"type": "lora",
"linear": 16,
"linear_alpha": 16
},
"save": {
"dtype": "float16",
"save_every": 250,
"max_step_saves_to_keep": 4,
"push_to_hub": false
},
"datasets": [
{
"folder_path": "D:\PICTURES_files\TRAINING\vw_mago1",
"caption_ext": "txt",
"caption_dropout_rate": 0.05,
"shuffle_tokens": false,
"cache_latents_to_disk": true,
"resolution": [
512,
768,
1024
]
}
],
"train": {
"batch_size": 1,
"steps": 2000,
"gradient_accumulation_steps": 1,
"train_unet": true,
"train_text_encoder": false,
"gradient_checkpointing": true,
"noise_scheduler": "flowmatch",
"optimizer": "adamw8bit",
"lr": 0.0001,
"ema_config": {
"use_ema": true,
"ema_decay": 0.99
},
"dtype": "bf16"
},
"model": {
"name_or_path": "black-forest-labs/FLUX.1-dev",
"is_flux": true,
"quantize": true
},
"sample": {
"sampler": "flowmatch",
"sample_every": 250,
"width": 1024,
"height": 1024,
"prompts": [
"woman with red hair, playing chess at the park, bomb going off in the background",
"a woman holding a coffee cup, in a beanie, sitting at a cafe",
"a horse is a DJ at a night club, fish eye lens, smoke machine, lazer lights, holding a martini",
"a man showing off his cool new t shirt at the beach, a shark is jumping out of the water in the background",
"a bear building a log cabin in the snow covered mountains",
"woman playing the guitar, on stage, singing a song, laser lights, punk rocker",
"hipster man with a beard, building a chair, in a wood shop",
"photo of a man, white background, medium shot, modeling clothing, studio lighting, white backdrop",
"a man holding a sign that says, 'this is a sign'",
"a bulldog, in a post apocalyptic world, with a shotgun, in a leather jacket, in a desert, with a motorcycle"
],
"neg": "",
"seed": 42,
"walk_seed": true,
"guidance_scale": 4,
"sample_steps": 20
}
}
Using EMA
C:\COMFY\ComfyUI_windows_portable\ComfyUI\ai-toolkit\extensions_built_in\sd_trainer\SDTrainer.py:61: FutureWarning: torch.cuda.amp.GradScaler(args...) is deprecated. Please use torch.amp.GradScaler('cuda', args...) instead.
self.scaler = torch.cuda.amp.GradScaler()

#############################################

Running job: vw_mago1_lora_v1

#############################################

Running 1 process
Loading Flux model
Loading transformer
Error running job: black-forest-labs/FLUX.1-dev is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with token or log in with huggingface-cli login.

========================================
Result:
- 0 completed jobs
- 1 failure

Traceback (most recent call last):
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\utils_errors.py", line 304, in hf_raise_for_status
response.raise_for_status()
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/transformer/config.json

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\diffusers\configuration_utils.py", line 379, in load_config
config_file = hf_hub_download(
^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\utils_deprecation.py", line 101, in inner_f
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\file_download.py", line 1240, in hf_hub_download
return _hf_hub_download_to_cache_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\file_download.py", line 1347, in _hf_hub_download_to_cache_dir
_raise_on_head_call_error(head_call_error, force_download, local_files_only)
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\file_download.py", line 1854, in _raise_on_head_call_error
raise head_call_error
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\file_download.py", line 1751, in _get_metadata_or_catch_error
metadata = get_hf_file_metadata(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\file_download.py", line 1673, in get_hf_file_metadata
r = _request_wrapper(
^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\file_download.py", line 376, in _request_wrapper
response = _request_wrapper(
^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\file_download.py", line 400, in _request_wrapper
hf_raise_for_status(response)
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\utils_errors.py", line 321, in hf_raise_for_status
raise GatedRepoError(message, response) from e
huggingface_hub.utils._errors.GatedRepoError: 401 Client Error. (Request ID: Root=1-66cecd45-1f2cc6a96e9d4e331aa3a1f6;7641e2c7-2f42-4e25-bcc2-b0f18d9f630c)

Cannot access gated repo for url https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/transformer/config.json.
Access to model black-forest-labs/FLUX.1-dev is restricted. You must be authenticated to access it.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\COMFY\ComfyUI_windows_portable\ComfyUI\ai-toolkit\run.py", line 90, in
main()
File "C:\COMFY\ComfyUI_windows_portable\ComfyUI\ai-toolkit\run.py", line 86, in main
raise e
File "C:\COMFY\ComfyUI_windows_portable\ComfyUI\ai-toolkit\run.py", line 78, in main
job.run()
File "C:\COMFY\ComfyUI_windows_portable\ComfyUI\ai-toolkit\jobs\ExtensionJob.py", line 22, in run
process.run()
File "C:\COMFY\ComfyUI_windows_portable\ComfyUI\ai-toolkit\jobs\process\BaseSDTrainProcess.py", line 1233, in run
self.sd.load_model()
File "C:\COMFY\ComfyUI_windows_portable\ComfyUI\ai-toolkit\toolkit\stable_diffusion_model.py", line 488, in load_model
transformer = FluxTransformer2DModel.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\diffusers\models\modeling_utils.py", line 612, in from_pretrained
config, unused_kwargs, commit_hash = cls.load_config(
^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\ai-toolkit\venv\Lib\site-packages\diffusers\configuration_utils.py", line 394, in load_config
raise EnvironmentError(
OSError: black-forest-labs/FLUX.1-dev is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with token or log in with huggingface-cli login.

I had the same problem and the thing that helped me to solve it was to go back to:

https://huggingface.co/black-forest-labs/FLUX.1-dev/

And accept the T&C.

@FridaRuh thanks for your response... but i accepted them before and now i was trying to find a way, to accept them again... but i don't know how :/

I had the same problem and the thing that helped me to solve it was to go back to:

https://huggingface.co/black-forest-labs/FLUX.1-dev/

And accept the T&C.

I encountered the same problem and accepted the terms, but it still occurred.

I had the same problem and the thing that helped me to solve it was to go back to:

https://huggingface.co/black-forest-labs/FLUX.1-dev/

And accept the T&C.

I encountered the same problem and accepted the terms, but it still occurred.

Review the extension of yours images

Review the extension of yours images

Is there something wrong with the dataset?

I had the same problem and the thing that helped me to solve it was to go back to:

https://huggingface.co/black-forest-labs/FLUX.1-dev/

And accept the T&C.

Thank you. I think this is working.

Yes i have the same error and the problem was the image extension in my case the image had the extension .webp buy before change the extension to jpg the train works fine

Yes i have the same error and the problem was the image extension in my case the image had the extension .webp buy before change the extension to jpg the train works fine

There is no real change, because my extension is also jpg. The error still exists.

Sign up or log in to comment