Skip to content

DummyObjects are impeding PyCharm #1479

Closed
@keturn

Description

@keturn

I'm subclassing StableDiffusionPipeline (because it seems like that's the intended way to make a DiffusionPipeline that is still able to take advantage of StableDiffusionPipeline's methods to enable attention slicing, decode latents, etc.), and I've noticed a distinct lack of help from the IDE when it comes to attributes and arguments that I know this class has.

I think that's because when I hit "go to definition" of the StableDiffusionPipeline I'm using as a superclass, it brings me to this

class StableDiffusionPipeline(metaclass=DummyObject):
_backends = ["torch", "transformers"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch", "transformers"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["torch", "transformers"])
@classmethod
def from_pretrained(cls, *args, **kwargs):
requires_backends(cls, ["torch", "transformers"])

no defined arguments to the class __init__, no indication that it's an ancestor of DiffusionPipeline, no __call__ method, none of the documentation or type hits that you've so diligently included in your code.

Should I be importing directly from the full path diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline instead of diffusers.StableDiffusionPipeline?

If so, please remove the diffusers.StableDiffusionPipeline stunt double so that I'm not presented with two options when autocompleting and left to probably pick the wrong one.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions