Instructions to use genmo/mochi-1-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use genmo/mochi-1-preview with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("genmo/mochi-1-preview", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Genmo
How to use genmo/mochi-1-preview with Genmo:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Inference
- Notebooks
- Google Colab
- Kaggle
clip_feat_dim unexpected by AsymmetricAttention.__init__()
Hi, I'm trying to hack on the code a bit to see if I can get this to run on a single <48Gb node and ran into a few problems.
clip_feat_dim from the yaml isn't expected but it is passed by **block_kwargs into AsymmetricAttention.init which won't accept it.
I was able to work around this by adding **block_kwargs to the init function so any extra kwargs are effectively ignored, but just a heads up.
Also this assert fails in t2v_synth_mochi.py:
assert y_feat[-1].shape == (B, MAX_T5_TOKEN_LENGTH, 4096)
It seemingly matches, but the tensor.shape function returns a tensor, not a tuple:
print(f"y_feat[-1].shape = {y_feat[-1].shape}")
Output:
(T2VSynthMochiModel pid=3652095) y_feat[-1].shape = torch.Size([2, 256, 4096])
I temporarily corrected it to this, which works:
assert y_feat[-1].shape == torch.zeros(B, MAX_T5_TOKEN_LENGTH, 4096).shape
Edit: for anyone else trying to downsize, set num_workers = 1 in infer.py line 35, if I can get it working I'll share code. Trying 16bit and possibly bitsandbytes to see if I can get it down a bit...
Both issues should now be fixed! Thanks for the detailed bug report, and lmk if you run into anything else.

