Instructions to use cvssp/audioldm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use cvssp/audioldm with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("cvssp/audioldm", 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
cannot unpack non-iterable NoneType object
#6
by dkackman - opened
Running your example code I get "cannot unpack non-iterable NoneType object" from the line scipy.io.wavfile.write("techno.wav", rate=16000, data=audio)
Windows 11, python 3.10, scipy==1.10.1
Anyone see the same thing?
EDIT
I just realized that this is not being thrown as an error, but logged to stdout. Windows does not like the resulting wav file however.
EDIT 2
After casting the aduio to float32 the wav file works on windows.
scipy.io.wavfile.write("techno.wav", rate=16000, data=audio.astype(np.float32))
still get the NoneType message but that's not a big deal
Sorry! That's the correct fix! Opened a PR to fix in diffusers so that you don't have to do the dtype conversion yourself https://github.com/huggingface/diffusers/pull/3189
Coolio. I'll close this.
Thanks!
dkackman changed discussion status to closed