§
    òwŠiz  ã                   ó<   — d dl mZ ddlmZmZ  G d„ d¦  «        ZdS )é    )Úvalidate_hf_hub_argsé   )Ú*create_diffusers_controlnet_model_from_ldmÚfetch_ldm_config_and_checkpointc                   ó8   — e Zd ZdZeed„ ¦   «         ¦   «         ZdS )ÚFromOriginalControlNetMixinzv
    Load pretrained ControlNet weights saved in the `.ckpt` or `.safetensors` format into a [`ControlNetModel`].
    c                 óò  — |                      dd¦  «        }|                      dd¦  «        }|                      dd¦  «        }|                      dd¦  «        }|                      dd¦  «        }|                      dd¦  «        }|                      d	d¦  «        }	|                      d
d¦  «        }
|                      dd¦  «        }|                      dd¦  «        }| j        }||t          d¦  «        ‚|p|}t          |||||||||
|	¬¦
  «
        \  }}|                      dd¦  «        }|                      dd¦  «        }t	          ||||||¬¦  «        }|d         }||                     |¦  «        }|S )a“  
        Instantiate a [`ControlNetModel`] from pretrained ControlNet weights saved in the original `.ckpt` or
        `.safetensors` format. The pipeline is set in evaluation mode (`model.eval()`) by default.

        Parameters:
            pretrained_model_link_or_path (`str` or `os.PathLike`, *optional*):
                Can be either:
                    - A link to the `.ckpt` file (for example
                      `"https://huggingface.co/<repo_id>/blob/main/<path_to_file>.ckpt"`) on the Hub.
                    - A path to a *file* containing all pipeline weights.
            config_file (`str`, *optional*):
                Filepath to the configuration YAML file associated with the model. If not provided it will default to:
                https://raw.githubusercontent.com/lllyasviel/ControlNet/main/models/cldm_v15.yaml
            torch_dtype (`str` or `torch.dtype`, *optional*):
                Override the default `torch.dtype` and load the model with another dtype. If `"auto"` is passed, the
                dtype is automatically derived from the model's weights.
            force_download (`bool`, *optional*, defaults to `False`):
                Whether or not to force the (re-)download of the model weights and configuration files, overriding the
                cached versions if they exist.
            cache_dir (`Union[str, os.PathLike]`, *optional*):
                Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
                is not used.
            resume_download:
                Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
                of Diffusers.
            proxies (`Dict[str, str]`, *optional*):
                A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
                'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
            local_files_only (`bool`, *optional*, defaults to `False`):
                Whether to only load local model weights and configuration files or not. If set to True, the model
                won't be downloaded from the Hub.
            token (`str` or *bool*, *optional*):
                The token to use as HTTP bearer authorization for remote files. If `True`, the token generated from
                `diffusers-cli login` (stored in `~/.huggingface`) is used.
            revision (`str`, *optional*, defaults to `"main"`):
                The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
                allowed by Git.
            image_size (`int`, *optional*, defaults to 512):
                The image size the model was trained on. Use 512 for all Stable Diffusion v1 models and the Stable
                Diffusion v2 base model. Use 768 for Stable Diffusion v2.
            upcast_attention (`bool`, *optional*, defaults to `None`):
                Whether the attention computation should always be upcasted.
            kwargs (remaining dictionary of keyword arguments, *optional*):
                Can be used to overwrite load and saveable variables (for example the pipeline components of the
                specific pipeline class). The overwritten components are directly passed to the pipelines `__init__`
                method. See example below for more information.

        Examples:

        ```py
        from diffusers import StableDiffusionControlNetPipeline, ControlNetModel

        url = "https://huggingface.co/lllyasviel/ControlNet-v1-1/blob/main/control_v11p_sd15_canny.pth"  # can also be a local path
        model = ControlNetModel.from_single_file(url)

        url = "https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned.safetensors"  # can also be a local path
        pipe = StableDiffusionControlNetPipeline.from_single_file(url, controlnet=controlnet)
        ```
        Úoriginal_config_fileNÚconfig_fileÚresume_downloadÚforce_downloadFÚproxiesÚtokenÚ	cache_dirÚlocal_files_onlyÚrevisionÚtorch_dtypez|You cannot pass both `config_file` and `original_config_file` to `from_single_file`. Please use only one of these arguments.)
Úpretrained_model_link_or_pathÚ
class_namer
   r   r   r   r   r   r   r   Úupcast_attentionÚ
image_size)r   r   r   Ú
controlnet)ÚpopÚ__name__Ú
ValueErrorr   r   Úto)Úclsr   Úkwargsr
   r   r   r   r   r   r   r   r   r   r   Úoriginal_configÚ
checkpointr   r   Ú	componentr   s                       úl/root/.openclaw/workspace/chatterbox_venv_py311/lib/python3.11/site-packages/diffusers/loaders/controlnet.pyÚfrom_single_filez,FromOriginalControlNetMixin.from_single_file   s²  € ð|  &ŸzšzÐ*@À$ÑGÔGÐØ—j’j °Ñ5Ô5ˆØ Ÿ*š*Ð%6¸Ñ=Ô=ˆØŸšÐ$4°eÑ<Ô<ˆØ—*’*˜Y¨Ñ-Ô-ˆØ—
’
˜7 DÑ)Ô)ˆØ—J’J˜{¨DÑ1Ô1ˆ	Ø!Ÿ:š:Ð&8¸$Ñ?Ô?ÐØ—:’:˜j¨$Ñ/Ô/ˆØ—j’j °Ñ5Ô5ˆà”\ˆ
ØÐ#Ð*>Ð*JÝð Oñô ð ð  +ÐBÐ.BÐÝ&EØ*GØ!Ø!5Ø+Ø)ØØØØ-Øð'
ñ '
ô '
Ñ#ˆ˜ð "Ÿ:š:Ð&8¸%Ñ@Ô@ÐØ—Z’Z ¨dÑ3Ô3ˆ
å>ØØØØ-Ø!Ø#ð
ñ 
ô 
ˆ	ð ˜|Ô,ˆ
ØÐ"Ø#Ÿš {Ñ3Ô3ˆJàÐó    N)r   Ú
__module__Ú__qualname__Ú__doc__Úclassmethodr   r#   © r$   r"   r   r      sI   € € € € € ðð ð Øðjð jñ Ôñ „[ðjð jð jr$   r   N)Úhuggingface_hub.utilsr   Úsingle_file_utilsr   r   r   r)   r$   r"   ú<module>r,      s}   ðð 7Ð 6Ð 6Ð 6Ð 6Ð 6ðð ð ð ð ð ð ð ðqð qð qð qð qñ qô qð qð qð qr$   