mimetic-a0 Prompt (BPM and bars)
The two-line trick that makes a music model actually keep tempo
- prompt
- seconds
Most text-to-music prompts fail for a dumb, mechanical reason: you asked for four bars at 90 BPM, then told the sampler to generate eight seconds. Those are two different songs. A bar of 4/4 at 90 BPM is 2.67 seconds, so four bars is 10.67 - and the model receives the duration both as words in your prompt and as a number embedded in the conditioning. Contradict those and it splits the difference, which sounds like a loop whose downbeat drifts.
This node exists to stop that. It's the GUI version of the command line's --bpm and --bars flags, and it emits both halves at once: the prompt text and the exact length.
What it does
You give it a prompt, a tempo, a bar count. It appends the missing clauses to the prompt and computes the length. That's it - no model call, no magic, about fifteen lines of Python.
The clause-adding is conservative. It checks for a tempo with a digit-plus-"BPM" pattern and a length with digit-plus-"bar", so a prompt that already says 90 BPM, 4 bars is left alone. If it doesn't, it appends , 90 BPM and , 4 bars in that order - which matters, because the model's training captions run what it is, then the music, then tempo, key and length, and it follows the wording it was trained on more than it follows good grammar on your part.
The length math is plain 4/4 arithmetic: bars × 240 ÷ BPM. 4 bars at 90 BPM gives 10.67 s. 2 bars at 100 gives 4.8 s.
The inputs
prompt is the multiline text box, pre-filled with boom bap drum loop, standard kit, swung, with ghost notes.
bpm is a float, default 90. Zero is special: it means "add no tempo clause at all," which you use when the tempo is implied by the prompt or you genuinely don't care.
bars is a combo of off, 1, 2, 4, defaulting to 4. Those aren't arbitrary - the model only knows one, two or four bars of 4/4. Asking for three bars isn't a feature it's hiding.
seconds is the fallback length, used only when bpm is 0 or bars is off. Range is 0.1 to 16.
Then the outputs: prompt goes into a CLIP Text Encode node, which goes into the Sampler's positive. seconds goes into the Sampler's seconds. Wire both. If you wire only the prompt and leave the Sampler at its default 8 seconds, you've recreated the bug this node was built to fix.
Prompts that work
Straight from the model's own guide, and worth copying the shape of:
hip hop drum loop, standard kit, swung, with ghost notes, 90 BPM, 4 bars
finger bass bassline, over Cm - Fm - G7, sparse, 95 BPM, C minor, 4 bars
electric piano chords, chords Am7 - D9 - Gmaj7, smooth, sustained, 100 BPM, G major, 2 bars
808 kit snare hit, one-shot, hard
Note the last one. One-shots don't need tempo or length, so you'd set bpm to 0, bars to off and give it a short seconds. The PROMPTING.md the download script drops into your model folder lists the vocabulary the model actually understands - read it once, it's cheaper than guessing.
Traps
Don't describe tempo in words. The node only detects a numeric tempo. Write slow, moody keys with bpm at 90 and you get slow, moody keys, 90 BPM - a prompt arguing with itself. Put the number in the bpm field and keep the prose for everything else.
Low BPM eats your bars. Four bars at 60 BPM is exactly 16 seconds, which is the model's hard ceiling. Go below that and the length you asked for doesn't fit: the sampler clamps to 16 s and the decode trims to it, so you get a take that's missing the end of its fourth bar. At 50 BPM, ask for 2 bars instead.
Keep prompts short. The official code truncates prompts at 128 T5 tokens; ComfyUI's T5-base doesn't, so a long prompt is conditioned differently than the reference implementation - and the model's own guide uses prompts far shorter than that limit anyway. Comma-separated clauses, not paragraphs.
It's a music model. Asking for field recordings or foley is asking for the weak part of the training data. Per the model's README, most instruments sound like General MIDI samples and the autoencoder eats the top octave and noise textures - that's the model, not your settings.
Install
Manager (search the pack title), the Registry id mimetic-a0-music, or:
cd ComfyUI/custom_nodes
git clone https://github.com/hiroki-abe-58/ComfyUI-MimeticA0
No Python dependencies beyond ComfyUI's own. You do need the model files before any of this produces sound:
python custom_nodes/ComfyUI-MimeticA0/tools/download_model.py --models-dir models
That grabs the weights into models/mimetic_a0/mimetic-a0/ and t5_base.safetensors into models/text_encoders/, pinned and SHA-256 checked. Restart, load workflows/gui/text_to_music.json, and you have a 90 BPM boom bap loop to poke at.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | boom bap drum loop, standard kit, swung, with ghost notes | — |
| bpm | FLOAT | 90.00–300 | 0: no tempo clause |
| bars | COMBO | 4 | the model knows 1, 2 or 4 bars of 4/4 |
| seconds | FLOAT | 8.000.1–16 | the length when bpm or bars is off |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| seconds | FLOAT | — |