Nodes/scg_Foundation-1-comfyUI/SCG Foundation-1 Sample Generator
ComfyUI Node

SCG Foundation-1 Sample Generator

The SCG Foundation-1 Sample Generator is where the music actually happens

By SanDiegoDude·Created 6 months ago·Updated 6 months ago· 19
SCG Foundation-1 Sample Generator
  • model
  • init_audio
  • audio
promptSynth Lead, Warm, Bright, Melody
bars8
bpm128
keyC
scaleminor
seed-1
steps75
cfg_scale7.0
sampler_typedpmpp-3m-sde
sigma_min0.03
sigma_max500
autoplaytrue
negative_prompt
init_noise_level0.90

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, so Synth Lead, Warm, Melody with 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. Leave sigma_min and sigma_max alone unless you know why you're touching them.
  • seed - -1 means 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 AUDIO in 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.

Categoryaudio/SCG Foundation-1

Inputs (16)

NameTypeDefaultDescription
modelF1_MODEL
promptSTRINGSynth Lead, Warm, Bright, Melody
barsCOMBO82 options: 4, 8
bpmCOMBO1287 options: 100, 110, 120, 128, 130, 140, +1
keyCOMBOC12 options: C, C#, D, D#, E, F, +6
scaleCOMBOminor2 options: major, minor
seedINT-1-1–2147483647
stepsINT751–500
cfg_scaleFLOAT7.00–25
sampler_typeCOMBOdpmpp-3m-sde7 options: dpmpp-3m-sde, dpmpp-2m-sde, k-heun, k-lms, k-dpmpp-2s-ancestral, k-dpm-2, +1
sigma_minFLOAT0.030–2
sigma_maxFLOAT5000–1000
autoplayBOOLEANtrue
negative_promptoptSTRING
init_audiooptAUDIO
init_noise_leveloptFLOAT0.900.01–5

Outputs (1)

NameTypeDescription
audioAUDIO