Instructions to use rooroo79/music-spectrogram-diffusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use rooroo79/music-spectrogram-diffusion with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("rooroo79/music-spectrogram-diffusion", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
File size: 1,263 Bytes
f6137ac e2f8bfe f6137ac e2f8bfe f6137ac e2f8bfe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | """Shim for this checkpoint's model_index.json.
The Google weights name the note/context encoders as library
`spectrogram_diffusion`. Diffusers' from_pretrained() does:
library = importlib.import_module("spectrogram_diffusion")
class_obj = getattr(library, "SpectrogramContEncoder")
class_candidates = {name: getattr(library, name, None) for name in LOADABLE_CLASSES}
so this module must export both the encoder classes *and* ModelMixin
(otherwise loading raises: no from_pretrained on the component).
"""
from __future__ import annotations
from diffusers import ModelMixin
try:
from diffusers.pipelines.deprecated.spectrogram_diffusion.continuous_encoder import (
SpectrogramContEncoder,
)
from diffusers.pipelines.deprecated.spectrogram_diffusion.notes_encoder import (
SpectrogramNotesEncoder,
)
except ImportError: # older Diffusers still used the non-deprecated path
from diffusers.pipelines.spectrogram_diffusion.continuous_encoder import ( # type: ignore
SpectrogramContEncoder,
)
from diffusers.pipelines.spectrogram_diffusion.notes_encoder import ( # type: ignore
SpectrogramNotesEncoder,
)
__all__ = ["ModelMixin", "SpectrogramContEncoder", "SpectrogramNotesEncoder"]
|