SCG Foundation-1 Sample Generator
The SCG Foundation-1 Sample Generator is where the music actually happens
- model
- init_audio
- audio
Everything else in this pack exists to feed this node. The SCG Foundation-1 Sample Generator takes the loaded model plus a prompt and runs the diffusion pass that turns tags into a tempo-synced, key-aware music loop. It's the main event: set BPM, bars, key, scale, and sampler parameters, hit Run, and a playable AUDIO result appears on the node with its own preview player.
The pitch, in case you haven't met Foundation-1 yet: it's RoyalCities' structured text-to-sample model, a 2026 release built on Stability's stable-audio-tools, that generates production-ready loops with unusually strong prompt adherence - instruments, timbre, FX, structure, down to the beat grid. Where generic audio diffusion gives you "a sound," this gives you "a loop that locks to 128 BPM in C minor." The Sample Generator is what makes that alignment automatic.
How it works
The interesting engineering is behind the curtain. ComfyUI ships a heavily modified k_diffusion that's incompatible with stable-audio-tools - it lacks the external submodule, and its patched samplers demand ComfyUI-only model_patcher objects that break the model wrapper. This pack bundles the unmodified upstream k_diffusion and temporarily swaps it in during generation, then swaps back. You never see any of it, but it's why the pack works at all instead of erroring on step one.
The timing math is the actual feature, though. The node computes the exact sample count for your bars and BPM (4 beats per bar), generates slightly long, then trims to the precise loop length and applies a ~15 ms fade-out so the loop point doesn't click. Output is peak-normalized so it won't clip. "Loop-accurate" is the headline, and it delivers.
Inputs you'll actually touch
- prompt - the tag string from the Prompt Builder or Random Prompt (or typed by hand). The sampler auto-appends
key scale, bars bars, BPM BPM, soSynth Lead, Warm, Melodywith C / minor / 8 bars / 128 BPM becomes the full conditioning text. Stick to Foundation-1's tag vocabulary for best results. - bars / bpm / key / scale - 4 or 8 bars, 100–150 BPM, all 12 keys, major or minor. These are what make the output loop-clean.
- steps / cfg_scale / sampler_type - the diffusion dials. The defaults are sane (75 steps, CFG 7,
dpmpp-3m-sde). Lower steps are faster and rougher; the other samplers (k-heun,k-lms,k-dpm-fast, …) are standard k-diffusion fare. Leavesigma_minandsigma_maxalone unless you know why you're touching them. - seed -
-1means random every run; set a number to reproduce a result. - negative_prompt - optional, same tag vocabulary, tells the model what to avoid. Genuinely useful for killing unwanted FX or instrument bleed.
- init_audio + init_noise_level - the audio-to-audio path. Feed any ComfyUI
AUDIOin as init audio and it becomes a style-transfer/remix;init_noise_level(0.9 default) controls how much of the original survives. - autoplay - whether the on-node preview plays immediately.
The single output, audio (AUDIO), wires into ComfyUI's audio-saving nodes (like VideoHelperSuite's SaveAudio) or anything else that accepts AUDIO.
Installing, and the one landmine
Install via ComfyUI Manager (search "SCG Foundation-1"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/SanDiegoDude/scg_Foundation-1-comfyUI
cd scg_Foundation-1-comfyUI
python install.py
Do not run pip install -r requirements.txt on its own and do not pip install stable-audio-tools normally - stable-audio-tools force-pins ancient torch/numpy/pandas and will destroy your ComfyUI environment. install.py installs it with --no-deps plus the lightweight inference deps. If you get a "stable-audio-tools is required" error at generation time, that's the fix.
Hardware and honest expectations
Generation wants roughly 7 GB VRAM, so 8 GB is the realistic floor; a 6 GB card is going to struggle. The first run downloads ~1.5 GB of weights plus a tokenizer, cached under models/audio_checkpoints/Foundation-1/. Keep the model loaded (the Loader's default) between generations or you'll eat reload time. And temper expectations on length: the model is loop-oriented, which is exactly why bars cap at 8. Foundation-1 is a sample generator, not a full-song machine - but within that lane it's excellent, and this node is the cleanest way to drive it.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| model | F1_MODEL | — | |
| prompt | STRING | Synth Lead, Warm, Bright, Melody | — |
| bars | COMBO | 8 | 2 options: 4, 8 |
| bpm | COMBO | 128 | 7 options: 100, 110, 120, 128, 130, 140, +1 |
| key | COMBO | C | 12 options: C, C#, D, D#, E, F, +6 |
| scale | COMBO | minor | 2 options: major, minor |
| seed | INT | -1-1–2147483647 | — |
| steps | INT | 751–500 | — |
| cfg_scale | FLOAT | 7.00–25 | — |
| sampler_type | COMBO | dpmpp-3m-sde | 7 options: dpmpp-3m-sde, dpmpp-2m-sde, k-heun, k-lms, k-dpmpp-2s-ancestral, k-dpm-2, +1 |
| sigma_min | FLOAT | 0.030–2 | — |
| sigma_max | FLOAT | 5000–1000 | — |
| autoplay | BOOLEAN | true | — |
| negative_promptopt | STRING | — | |
| init_audioopt | AUDIO | — | |
| init_noise_levelopt | FLOAT | 0.900.01–5 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |