Skip to content

AttributeError: 'StableDiffusionPipeline' object has no attribute 'modules' #57

Open
@vkvickkey

Description

@vkvickkey

WARNING:xformers:WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
PyTorch 2.2.0+cu121 with CUDA 1201 (you have 2.5.1+cu121)
Python 3.11.7 (you have 3.11.11)
Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
Memory-efficient attention, SwiGLU, sparse and more won't be available.
Set XFORMERS_MORE_DETAILS=1 for more details
/usr/local/lib/python3.11/dist-packages/xformers/ops/swiglu_op.py:106: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead.
@torch.cuda.amp.custom_fwd
/usr/local/lib/python3.11/dist-packages/xformers/ops/swiglu_op.py:127: FutureWarning: torch.cuda.amp.custom_bwd(args...) is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda') instead.
@torch.cuda.amp.custom_bwd

Loading pipeline components...: 100%
 6/6 [00:16<00:00,  3.99s/it]

You have disabled the safety checker for <class 'diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline'> by passing safety_checker=None. Ensure that you abide to the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend to keep the safety filter enabled in all public facing circumstances, disabling it only for use-cases that involve analyzing network behavior or auditing its results. For more information, please have a look at huggingface/diffusers#254 .


AttributeError Traceback (most recent call last)

in <cell line: 0>()
10
11 # Force the model to use float16 for all computations
---> 12 for module in pipe.modules():
13 if isinstance(module, torch.nn.Module):
14 module.to(dtype=torch.float16)

/usr/local/lib/python3.11/dist-packages/diffusers/configuration_utils.py in getattr(self, name)
141 return self._internal_dict[name]
142
--> 143 raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
144
145 def save_config(self, save_directory: Union[str, os.PathLike], push_to_hub: bool = False, **kwargs):

AttributeError: 'StableDiffusionPipeline' object has no attribute 'modules'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions