text stringlengths 41 89.8k | type stringclasses 1
value | start int64 79 258k | end int64 342 260k | depth int64 0 0 | filepath stringlengths 81 164 | parent_class null | class_index int64 0 1.38k |
|---|---|---|---|---|---|---|---|
class StableUnCLIPPipeline(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"])
@c... | class_definition | 67,319 | 67,754 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 700 |
class StableVideoDiffusionPipeline(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"])... | class_definition | 67,757 | 68,200 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 701 |
class TextToVideoSDPipeline(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"])
@... | class_definition | 68,203 | 68,639 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 702 |
class TextToVideoZeroPipeline(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"])
... | class_definition | 68,642 | 69,080 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 703 |
class TextToVideoZeroSDXLPipeline(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"])
... | class_definition | 69,083 | 69,525 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 704 |
class UnCLIPImageVariationPipeline(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"])... | class_definition | 69,528 | 69,971 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 705 |
class UnCLIPPipeline(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"])
@classme... | class_definition | 69,974 | 70,403 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 706 |
class UniDiffuserModel(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"])
@class... | class_definition | 70,406 | 70,837 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 707 |
class UniDiffuserPipeline(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"])
@cl... | class_definition | 70,840 | 71,274 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 708 |
class UniDiffuserTextDecoder(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"])
... | class_definition | 71,277 | 71,714 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 709 |
class VersatileDiffusionDualGuidedPipeline(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", "transfo... | class_definition | 71,717 | 72,168 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 710 |
class VersatileDiffusionImageVariationPipeline(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", "tra... | class_definition | 72,171 | 72,626 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 711 |
class VersatileDiffusionPipeline(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"])
... | class_definition | 72,629 | 73,070 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 712 |
class VersatileDiffusionTextToImagePipeline(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", "transf... | class_definition | 73,073 | 73,525 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 713 |
class VideoToVideoSDPipeline(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"])
... | class_definition | 73,528 | 73,965 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 714 |
class VQDiffusionPipeline(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"])
@cl... | class_definition | 73,968 | 74,402 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 715 |
class WuerstchenCombinedPipeline(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"])
... | class_definition | 74,405 | 74,846 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 716 |
class WuerstchenDecoderPipeline(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"])
... | class_definition | 74,849 | 75,289 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 717 |
class WuerstchenPriorPipeline(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"])
... | class_definition | 75,292 | 75,730 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_objects.py | null | 718 |
class PushToHubMixin:
"""
A Mixin to push a model, scheduler, or pipeline to the Hugging Face Hub.
"""
def _upload_folder(
self,
working_dir: Union[str, os.PathLike],
repo_id: str,
token: Optional[str] = None,
commit_message: Optional[str] = None,
create_... | class_definition | 23,125 | 27,270 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/hub_utils.py | null | 719 |
class MidiProcessor(metaclass=DummyObject):
_backends = ["note_seq"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["note_seq"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["note_seq"])
@classmethod
def from_pretrained(cls, *args,... | class_definition | 129 | 505 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_note_seq_objects.py | null | 720 |
class KolorsImg2ImgPipeline(metaclass=DummyObject):
_backends = ["torch", "transformers", "sentencepiece"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch", "transformers", "sentencepiece"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls,... | class_definition | 129 | 633 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_and_sentencepiece_objects.py | null | 721 |
class KolorsPAGPipeline(metaclass=DummyObject):
_backends = ["torch", "transformers", "sentencepiece"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch", "transformers", "sentencepiece"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["t... | class_definition | 636 | 1,136 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_and_sentencepiece_objects.py | null | 722 |
class KolorsPipeline(metaclass=DummyObject):
_backends = ["torch", "transformers", "sentencepiece"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch", "transformers", "sentencepiece"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["torc... | class_definition | 1,139 | 1,636 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_transformers_and_sentencepiece_objects.py | null | 723 |
class FlaxStableDiffusionControlNetPipeline(metaclass=DummyObject):
_backends = ["flax", "transformers"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax", "transformers"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax", "transform... | class_definition | 129 | 577 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py | null | 724 |
class FlaxStableDiffusionImg2ImgPipeline(metaclass=DummyObject):
_backends = ["flax", "transformers"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax", "transformers"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax", "transformers... | class_definition | 580 | 1,025 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py | null | 725 |
class FlaxStableDiffusionInpaintPipeline(metaclass=DummyObject):
_backends = ["flax", "transformers"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax", "transformers"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax", "transformers... | class_definition | 1,028 | 1,473 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py | null | 726 |
class FlaxStableDiffusionPipeline(metaclass=DummyObject):
_backends = ["flax", "transformers"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax", "transformers"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax", "transformers"])
... | class_definition | 1,476 | 1,914 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py | null | 727 |
class FlaxStableDiffusionXLPipeline(metaclass=DummyObject):
_backends = ["flax", "transformers"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax", "transformers"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax", "transformers"])
... | class_definition | 1,917 | 2,357 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py | null | 728 |
class SpectrogramDiffusionPipeline(metaclass=DummyObject):
_backends = ["transformers", "torch", "note_seq"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["transformers", "torch", "note_seq"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["... | class_definition | 129 | 620 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_transformers_and_torch_and_note_seq_objects.py | null | 729 |
class DummyObject(type):
"""
Metaclass for the dummy objects. Any class inheriting from it will return the ImportError generated by
`requires_backend` each time a user tries to access any method of that class.
"""
def __getattr__(cls, key):
if key.startswith("_") and key not in ["_load_conn... | class_definition | 24,377 | 24,818 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/import_utils.py | null | 730 |
class OptionalDependencyNotAvailable(BaseException):
"""
An error indicating that an optional dependency of Diffusers was not found in the environment.
""" | class_definition | 30,619 | 30,786 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/import_utils.py | null | 731 |
class _LazyModule(ModuleType):
"""
Module class that surfaces all objects but only performs associated imports when the objects are requested.
"""
# Very heavily inspired by optuna.integration._IntegrationModule
# https://github.com/optuna/optuna/blob/master/optuna/integration/__init__.py
def _... | class_definition | 30,789 | 33,331 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/import_utils.py | null | 732 |
class LMSDiscreteScheduler(metaclass=DummyObject):
_backends = ["torch", "scipy"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["torch", "scipy"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["torch", "scipy"])
@classmethod
def fr... | class_definition | 129 | 536 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_torch_and_scipy_objects.py | null | 733 |
class FlaxControlNetModel(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **kwa... | class_definition | 129 | 495 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 734 |
class FlaxModelMixin(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **kwargs):... | class_definition | 498 | 859 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 735 |
class FlaxUNet2DConditionModel(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, ... | class_definition | 862 | 1,233 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 736 |
class FlaxAutoencoderKL(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **kwarg... | class_definition | 1,236 | 1,600 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 737 |
class FlaxDiffusionPipeline(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **k... | class_definition | 1,603 | 1,971 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 738 |
class FlaxDDIMScheduler(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **kwarg... | class_definition | 1,974 | 2,338 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 739 |
class FlaxDDPMScheduler(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **kwarg... | class_definition | 2,341 | 2,705 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 740 |
class FlaxDPMSolverMultistepScheduler(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, ... | class_definition | 2,708 | 3,086 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 741 |
class FlaxEulerDiscreteScheduler(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args... | class_definition | 3,089 | 3,462 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 742 |
class FlaxKarrasVeScheduler(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **k... | class_definition | 3,465 | 3,833 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 743 |
class FlaxLMSDiscreteScheduler(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, ... | class_definition | 3,836 | 4,207 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 744 |
class FlaxPNDMScheduler(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **kwarg... | class_definition | 4,210 | 4,574 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 745 |
class FlaxSchedulerMixin(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, **kwar... | class_definition | 4,577 | 4,942 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 746 |
class FlaxScoreSdeVeScheduler(metaclass=DummyObject):
_backends = ["flax"]
def __init__(self, *args, **kwargs):
requires_backends(self, ["flax"])
@classmethod
def from_config(cls, *args, **kwargs):
requires_backends(cls, ["flax"])
@classmethod
def from_pretrained(cls, *args, *... | class_definition | 4,945 | 5,315 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/dummy_flax_objects.py | null | 747 |
class BaseOutput(OrderedDict):
"""
Base class for all model outputs as dataclass. Has a `__getitem__` that allows indexing by integer or slice (like a
tuple) or strings (like a dictionary) that will ignore the `None` attributes. Otherwise behaves like a regular
Python dictionary.
<Tip warning={true... | class_definition | 1,081 | 4,952 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/utils/outputs.py | null | 748 |
class AutoencoderKLOutput(BaseOutput):
"""
Output of AutoencoderKL encoding method.
Args:
latent_dist (`DiagonalGaussianDistribution`):
Encoded outputs of `Encoder` represented as the mean and logvar of `DiagonalGaussianDistribution`.
`DiagonalGaussianDistribution` allows fo... | class_definition | 79 | 511 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/modeling_outputs.py | null | 749 |
class Transformer2DModelOutput(BaseOutput):
"""
The output of [`Transformer2DModel`].
Args:
sample (`torch.Tensor` of shape `(batch_size, num_channels, height, width)` or `(batch size, num_vector_embeds - 1, num_latent_pixels)` if [`Transformer2DModel`] is discrete):
The hidden states o... | class_definition | 525 | 1,041 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/modeling_outputs.py | null | 750 |
class Upsample1D(nn.Module):
"""A 1D upsampling layer with an optional convolution.
Parameters:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
use_conv_transpose (`bool`, default `F... | class_definition | 828 | 2,426 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/upsampling.py | null | 751 |
class Upsample2D(nn.Module):
"""A 2D upsampling layer with an optional convolution.
Parameters:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
use_conv_transpose (`bool`, default `F... | class_definition | 2,429 | 7,354 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/upsampling.py | null | 752 |
class FirUpsample2D(nn.Module):
"""A 2D FIR upsampling layer with an optional convolution.
Parameters:
channels (`int`, optional):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
out_channels (`int`, ... | class_definition | 7,357 | 12,567 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/upsampling.py | null | 753 |
class KUpsample2D(nn.Module):
r"""A 2D K-upsampling layer.
Parameters:
pad_mode (`str`, *optional*, default to `"reflect"`): the padding mode to use.
"""
def __init__(self, pad_mode: str = "reflect"):
super().__init__()
self.pad_mode = pad_mode
kernel_1d = torch.tensor(... | class_definition | 12,570 | 13,684 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/upsampling.py | null | 754 |
class CogVideoXUpsample3D(nn.Module):
r"""
A 3D Upsample layer using in CogVideoX by Tsinghua University & ZhipuAI # Todo: Wait for paper relase.
Args:
in_channels (`int`):
Number of channels in the input image.
out_channels (`int`):
Number of channels produced by th... | class_definition | 13,687 | 16,160 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/upsampling.py | null | 755 |
class Downsample1D(nn.Module):
"""A 1D downsampling layer with an optional convolution.
Parameters:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
out_channels (`int`, optional):
... | class_definition | 819 | 2,193 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/downsampling.py | null | 756 |
class Downsample2D(nn.Module):
"""A 2D downsampling layer with an optional convolution.
Parameters:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
out_channels (`int`, optional):
... | class_definition | 2,196 | 5,197 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/downsampling.py | null | 757 |
class FirDownsample2D(nn.Module):
"""A 2D FIR downsampling layer with an optional convolution.
Parameters:
channels (`int`):
number of channels in the inputs and outputs.
use_conv (`bool`, default `False`):
option to use a convolution.
out_channels (`int`, option... | class_definition | 5,200 | 9,400 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/downsampling.py | null | 758 |
class KDownsample2D(nn.Module):
r"""A 2D K-downsampling layer.
Parameters:
pad_mode (`str`, *optional*, default to `"reflect"`): the padding mode to use.
"""
def __init__(self, pad_mode: str = "reflect"):
super().__init__()
self.pad_mode = pad_mode
kernel_1d = torch.ten... | class_definition | 9,510 | 10,577 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/downsampling.py | null | 759 |
class CogVideoXDownsample3D(nn.Module):
# Todo: Wait for paper relase.
r"""
A 3D Downsampling layer using in [CogVideoX]() by Tsinghua University & ZhipuAI
Args:
in_channels (`int`):
Number of channels in the input image.
out_channels (`int`):
Number of channels ... | class_definition | 10,580 | 14,033 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/downsampling.py | null | 760 |
class GatedSelfAttentionDense(nn.Module):
r"""
A gated self-attention dense layer that combines visual features and object features.
Parameters:
query_dim (`int`): The number of channels in the query.
context_dim (`int`): The number of channels in the context.
n_heads (`int`): The n... | class_definition | 1,921 | 3,415 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention.py | null | 761 |
class JointTransformerBlock(nn.Module):
r"""
A Transformer block following the MMDiT architecture, introduced in Stable Diffusion 3.
Reference: https://arxiv.org/abs/2403.03206
Parameters:
dim (`int`): The number of channels in the input and output.
num_attention_heads (`int`): The num... | class_definition | 3,440 | 10,325 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention.py | null | 762 |
class BasicTransformerBlock(nn.Module):
r"""
A basic Transformer block.
Parameters:
dim (`int`): The number of channels in the input and output.
num_attention_heads (`int`): The number of heads to use for multi-head attention.
attention_head_dim (`int`): The number of channels in ea... | class_definition | 10,350 | 25,762 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention.py | null | 763 |
class LuminaFeedForward(nn.Module):
r"""
A feed-forward layer.
Parameters:
hidden_size (`int`):
The dimensionality of the hidden layers in the model. This parameter determines the width of the model's
hidden representations.
intermediate_size (`int`): The intermediat... | class_definition | 25,765 | 27,303 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention.py | null | 764 |
class TemporalBasicTransformerBlock(nn.Module):
r"""
A basic Transformer block for video like data.
Parameters:
dim (`int`): The number of channels in the input and output.
time_mix_inner_dim (`int`): The number of channels for temporal attention.
num_attention_heads (`int`): The nu... | class_definition | 27,328 | 32,297 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention.py | null | 765 |
class SkipFFTransformerBlock(nn.Module):
def __init__(
self,
dim: int,
num_attention_heads: int,
attention_head_dim: int,
kv_input_dim: int,
kv_input_dim_proj_use_bias: bool,
dropout=0.0,
cross_attention_dim: Optional[int] = None,
attention_bia... | class_definition | 32,300 | 34,482 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention.py | null | 766 |
class FreeNoiseTransformerBlock(nn.Module):
r"""
A FreeNoise Transformer block.
Parameters:
dim (`int`):
The number of channels in the input and output.
num_attention_heads (`int`):
The number of heads to use for multi-head attention.
attention_head_dim (`int... | class_definition | 34,507 | 50,766 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention.py | null | 767 |
class FeedForward(nn.Module):
r"""
A feed-forward layer.
Parameters:
dim (`int`): The number of channels in the input.
dim_out (`int`, *optional*): The number of channels in the output. If not given, defaults to `dim`.
mult (`int`, *optional*, defaults to 4): The multiplier to use f... | class_definition | 50,769 | 53,574 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention.py | null | 768 |
class Attention(nn.Module):
r"""
A cross attention layer.
Parameters:
query_dim (`int`):
The number of channels in the query.
cross_attention_dim (`int`, *optional*):
The number of channels in the encoder_hidden_states. If not given, defaults to `query_dim`.
... | class_definition | 1,620 | 38,027 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 769 |
class SanaMultiscaleAttentionProjection(nn.Module):
def __init__(
self,
in_channels: int,
num_attention_heads: int,
kernel_size: int,
) -> None:
super().__init__()
channels = 3 * in_channels
self.proj_in = nn.Conv2d(
channels,
chan... | class_definition | 38,030 | 38,791 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 770 |
class SanaMultiscaleLinearAttention(nn.Module):
r"""Lightweight multi-scale linear attention"""
def __init__(
self,
in_channels: int,
out_channels: int,
num_attention_heads: Optional[int] = None,
attention_head_dim: int = 8,
mult: float = 1.0,
norm_type: ... | class_definition | 38,794 | 41,491 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 771 |
class MochiAttention(nn.Module):
def __init__(
self,
query_dim: int,
added_kv_proj_dim: int,
processor: "MochiAttnProcessor2_0",
heads: int = 8,
dim_head: int = 64,
dropout: float = 0.0,
bias: bool = False,
added_proj_bias: bool = True,
... | class_definition | 41,494 | 43,957 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 772 |
class MochiAttnProcessor2_0:
"""Attention processor used in Mochi."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError("MochiAttnProcessor2_0 requires PyTorch 2.0. To use it, please upgrade PyTorch to 2.0.")
def __call__(
self,
at... | class_definition | 43,960 | 48,254 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 773 |
class AttnProcessor:
r"""
Default processor for performing attention-related computations.
"""
def __call__(
self,
attn: Attention,
hidden_states: torch.Tensor,
encoder_hidden_states: Optional[torch.Tensor] = None,
attention_mask: Optional[torch.Tensor] = None,
... | class_definition | 48,257 | 51,006 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 774 |
class CustomDiffusionAttnProcessor(nn.Module):
r"""
Processor for implementing attention for the Custom Diffusion method.
Args:
train_kv (`bool`, defaults to `True`):
Whether to newly train the key and value matrices corresponding to the text features.
train_q_out (`bool`, defau... | class_definition | 51,009 | 55,415 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 775 |
class AttnAddedKVProcessor:
r"""
Processor for performing attention-related computations with extra learnable key and value matrices for the text
encoder.
"""
def __call__(
self,
attn: Attention,
hidden_states: torch.Tensor,
encoder_hidden_states: Optional[torch.Tens... | class_definition | 55,418 | 58,327 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 776 |
class AttnAddedKVProcessor2_0:
r"""
Processor for performing scaled dot-product attention (enabled by default if you're using PyTorch 2.0), with extra
learnable key and value matrices for the text encoder.
"""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
... | class_definition | 58,330 | 61,779 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 777 |
class JointAttnProcessor2_0:
"""Attention processor used typically in processing the SD3-like self-attention projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError("AttnProcessor2_0 requires PyTorch 2.0, to use it, please upgrade PyTorch to ... | class_definition | 61,782 | 65,402 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 778 |
class PAGJointAttnProcessor2_0:
"""Attention processor used typically in processing the SD3-like self-attention projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError(
"PAGJointAttnProcessor2_0 requires PyTorch 2.0, to use it... | class_definition | 65,405 | 72,695 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 779 |
class PAGCFGJointAttnProcessor2_0:
"""Attention processor used typically in processing the SD3-like self-attention projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError(
"PAGCFGJointAttnProcessor2_0 requires PyTorch 2.0, to ... | class_definition | 72,698 | 80,242 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 780 |
class FusedJointAttnProcessor2_0:
"""Attention processor used typically in processing the SD3-like self-attention projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError("AttnProcessor2_0 requires PyTorch 2.0, to use it, please upgrade PyTorc... | class_definition | 80,245 | 83,617 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 781 |
class XFormersJointAttnProcessor:
r"""
Processor for implementing memory efficient attention using xFormers.
Args:
attention_op (`Callable`, *optional*, defaults to `None`):
The base
[operator](https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.Atte... | class_definition | 83,620 | 87,184 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 782 |
class AllegroAttnProcessor2_0:
r"""
Processor for implementing scaled dot-product attention (enabled by default if you're using PyTorch 2.0). This is
used in the Allegro model. It applies a normalization layer and rotary embedding on the query and key vector.
"""
def __init__(self):
if not ... | class_definition | 87,187 | 91,027 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 783 |
class AuraFlowAttnProcessor2_0:
"""Attention processor used typically in processing Aura Flow."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention") and is_torch_version("<", "2.1"):
raise ImportError(
"AuraFlowAttnProcessor2_0 requires PyTorch 2.0, to use... | class_definition | 91,030 | 94,871 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 784 |
class FusedAuraFlowAttnProcessor2_0:
"""Attention processor used typically in processing Aura Flow with fused projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention") and is_torch_version("<", "2.1"):
raise ImportError(
"FusedAuraFlowAttnProcesso... | class_definition | 94,874 | 98,859 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 785 |
class FluxAttnProcessor2_0:
"""Attention processor used typically in processing the SD3-like self-attention projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError("FluxAttnProcessor2_0 requires PyTorch 2.0, to use it, please upgrade PyTorch ... | class_definition | 98,862 | 102,788 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 786 |
class FluxAttnProcessor2_0_NPU:
"""Attention processor used typically in processing the SD3-like self-attention projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError(
"FluxAttnProcessor2_0_NPU requires PyTorch 2.0 and torch ... | class_definition | 102,791 | 107,319 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 787 |
class FusedFluxAttnProcessor2_0:
"""Attention processor used typically in processing the SD3-like self-attention projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError(
"FusedFluxAttnProcessor2_0 requires PyTorch 2.0, to use ... | class_definition | 107,322 | 111,394 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 788 |
class FusedFluxAttnProcessor2_0_NPU:
"""Attention processor used typically in processing the SD3-like self-attention projections."""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError(
"FluxAttnProcessor2_0_NPU requires PyTorch 2.0 and t... | class_definition | 111,397 | 116,039 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 789 |
class FluxIPAdapterJointAttnProcessor2_0(torch.nn.Module):
"""Flux Attention processor for IP-Adapter."""
def __init__(
self, hidden_size: int, cross_attention_dim: int, num_tokens=(4,), scale=1.0, device=None, dtype=None
):
super().__init__()
if not hasattr(F, "scaled_dot_product_... | class_definition | 116,042 | 122,492 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 790 |
class CogVideoXAttnProcessor2_0:
r"""
Processor for implementing scaled dot-product attention for the CogVideoX model. It applies a rotary embedding on
query and key vectors, but does not include spatial normalization.
"""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"... | class_definition | 122,495 | 125,340 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 791 |
class FusedCogVideoXAttnProcessor2_0:
r"""
Processor for implementing scaled dot-product attention for the CogVideoX model. It applies a rotary embedding on
query and key vectors, but does not include spatial normalization.
"""
def __init__(self):
if not hasattr(F, "scaled_dot_product_atten... | class_definition | 125,343 | 128,218 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 792 |
class XFormersAttnAddedKVProcessor:
r"""
Processor for implementing memory efficient attention using xFormers.
Args:
attention_op (`Callable`, *optional*, defaults to `None`):
The base
[operator](https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.At... | class_definition | 128,221 | 131,194 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 793 |
class XFormersAttnProcessor:
r"""
Processor for implementing memory efficient attention using xFormers.
Args:
attention_op (`Callable`, *optional*, defaults to `None`):
The base
[operator](https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.Attention... | class_definition | 131,197 | 135,144 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 794 |
class AttnProcessorNPU:
r"""
Processor for implementing flash attention using torch_npu. Torch_npu supports only fp16 and bf16 data types. If
fp32 is used, F.scaled_dot_product_attention will be used for computation, but the acceleration effect on NPU is
not significant.
"""
def __init__(self)... | class_definition | 135,147 | 139,570 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 795 |
class AttnProcessor2_0:
r"""
Processor for implementing scaled dot-product attention (enabled by default if you're using PyTorch 2.0).
"""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError("AttnProcessor2_0 requires PyTorch 2.0, to use it, plea... | class_definition | 139,573 | 143,425 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 796 |
class XLAFlashAttnProcessor2_0:
r"""
Processor for implementing scaled dot-product attention with pallas flash attention kernel if using `torch_xla`.
"""
def __init__(self, partition_spec: Optional[Tuple[Optional[str], ...]] = None):
if not hasattr(F, "scaled_dot_product_attention"):
... | class_definition | 143,428 | 148,346 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 797 |
class XLAFluxFlashAttnProcessor2_0:
r"""
Processor for implementing scaled dot-product attention with pallas flash attention kernel if using `torch_xla`.
"""
def __init__(self, partition_spec: Optional[Tuple[Optional[str], ...]] = None):
if not hasattr(F, "scaled_dot_product_attention"):
... | class_definition | 148,349 | 152,754 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 798 |
class MochiVaeAttnProcessor2_0:
r"""
Attention processor used in Mochi VAE.
"""
def __init__(self):
if not hasattr(F, "scaled_dot_product_attention"):
raise ImportError("AttnProcessor2_0 requires PyTorch 2.0, to use it, please upgrade PyTorch to 2.0.")
def __call__(
sel... | class_definition | 152,757 | 155,845 | 0 | /Users/nielsrogge/Documents/python_projecten/diffusers/src/diffusers/models/attention_processor.py | null | 799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.