Nerogar / OneTrainer

OneTrainer is a one-stop solution for all your stable diffusion training needs.
GNU Affero General Public License v3.0
1.63k stars 130 forks source link

[Bug]: Huggingface error despite using SD3 model locally #410

Open joneschunghk opened 1 month ago

joneschunghk commented 1 month ago

What happened?

Clearing cache directory D:/AI/Stable_Diffusion/Datasets/V6/V6/SD3/workspace-cache/run! You can disable this if you want to continue using the same cache.
Traceback (most recent call last):
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\stableDiffusion3\StableDiffusion3ModelLoader.py", line 232, in load
    self.__load_internal(
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\stableDiffusion3\StableDiffusion3ModelLoader.py", line 29, in __load_internal
    self.__load_diffusers(
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\stableDiffusion3\StableDiffusion3ModelLoader.py", line 46, in __load_diffusers
    tokenizer_1 = CLIPTokenizer.from_pretrained(
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\transformers\tokenization_utils_base.py", line 2053, in from_pretrained
    raise ValueError(
ValueError: Calling CLIPTokenizer.from_pretrained() with the path to a single file or url is not supported for this tokenizer. Use a model identifier or the path to a directory instead.

Traceback (most recent call last):
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\stableDiffusion3\StableDiffusion3ModelLoader.py", line 242, in load
    self.__load_diffusers(
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\stableDiffusion3\StableDiffusion3ModelLoader.py", line 46, in __load_diffusers
    tokenizer_1 = CLIPTokenizer.from_pretrained(
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\transformers\tokenization_utils_base.py", line 2053, in from_pretrained
    raise ValueError(
ValueError: Calling CLIPTokenizer.from_pretrained() with the path to a single file or url is not supported for this tokenizer. Use a model identifier or the path to a directory instead.

Traceback (most recent call last):
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\utils\_errors.py", line 304, in hf_raise_for_status
    response.raise_for_status()
  File "D:\AI\Stable_Diffusion\OneTrainer\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/api/models/stabilityai/stable-diffusion-3-medium-diffusers/revision/main

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

Traceback (most recent call last):
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\stableDiffusion3\StableDiffusion3ModelLoader.py", line 252, in load
    self.__load_safetensors(
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\stableDiffusion3\StableDiffusion3ModelLoader.py", line 163, in __load_safetensors
    pipeline = StableDiffusion3Pipeline.from_single_file(
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\src\diffusers\src\diffusers\loaders\single_file.py", line 409, in from_single_file
    cached_model_config_path = _download_diffusers_model_config_from_hub(
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\src\diffusers\src\diffusers\loaders\single_file.py", line 250, in _download_diffusers_model_config_from_hub
    cached_model_path = snapshot_download(
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\_snapshot_download.py", line 233, in snapshot_download
    raise api_call_error
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\_snapshot_download.py", line 164, in snapshot_download
    repo_info = api.repo_info(repo_id=repo_id, repo_type=repo_type, revision=revision, token=token)
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\hf_api.py", line 2491, in repo_info
    return method(
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "D:\AI\Stable_Diffusion\OneTrainer\venv\lib\site-packages\huggingface_hub\hf_api.py", line 2301, in model_info
    hf_raise_for_status(r)
  File "D:\AI\Stable_Diffusion\OneTrainer\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-66a5e386-58cc48f4588bcf456af74431;495213f0-0c15-451f-b774-befb23f62bcc)

Cannot access gated repo for url https://huggingface.co/api/models/stabilityai/stable-diffusion-3-medium-diffusers/revision/main.
Access to model stabilityai/stable-diffusion-3-medium-diffusers is restricted. You must be authenticated to access it.

Traceback (most recent call last):
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\ui\TrainUI.py", line 537, in __training_thread_function
    trainer.start()
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\trainer\GenericTrainer.py", line 118, in start
    self.model = self.model_loader.load(
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\StableDiffusion3FineTuneModelLoader.py", line 44, in load
    base_model_loader.load(model, model_type, model_names, weight_dtypes)
  File "D:\AI\Stable_Diffusion\OneTrainer\modules\modelLoader\stableDiffusion3\StableDiffusion3ModelLoader.py", line 273, in load
    raise Exception("could not load model: " + model_names.base_model)
Exception: could not load model: D:/AI/Stable_Diffusion/ComfyUI_windows_portable/ComfyUI/models/checkpoints/SD3/sd3_medium.safetensors

What did you expect would happen?

I have tried 3 different sizes of SD3 models, all with the same result

Relevant log output

No response

Output of pip freeze

No response

quzopl commented 1 month ago

onetrainer need to download images to use them offline