Random_Style_Mixture
Roll the Dice on Style, the IP-Adapter Way
- style_embeddings
- pos_embed
- batch_size
Style fatigue is real: you've got twenty reference images and you keep reaching for the same two. Random_Style_Mixture is the pack's answer - it samples random blends of your style embeddings, so each run hands you a different, never-quite-seen style direction. Think of it as a style lottery, and it's the most fun node in the Eden embedding family.
You feed it one EMBEDS stack - the kind Load_Embeddings_From_Folder produces from a folder of saved .pth files - plus avg_embed_norm, which is that loader's second output (the average vector norm of your stack, used as the renormalization target). Then it does this, per sample:
- Randomly pick
num_style_components(default 4) styles from the stack. - Give each a random weight sampled from
[min_weight, 1.0](defaultmin_weight0.2), normalized so the mean weight is 1. - Sum the weighted styles into one blend, then rescale it to
avg_embed_normso the result sits at the same "volume" as your originals.
It repeats that num_samples (default 4) times, so the output pos_embed is a small batch of random style directions, and it also returns batch_size (the actual count) as an INT in case you want to wire the number into a batch-aware node downstream. Each sample uses torch.randperm, so the selection is fresh every run.
Why this works
Two ideas make it taste good. First, IP-Adapter embedding space is roughly arithmetic - blending directions and re-normalizing lands you on plausible in-between styles, same reason Linear_Combine_IP_Embeds interpolates smoothly. Second, the num_style_components-with-random-weights design means you're not just picking one style or a straight average; you're getting genuinely new combinations, some close to an original, some surprising mixtures. min_weight keeps the blends honest by stopping a single style from vanishing entirely. For creative exploration - "I don't know what I want, show me options" - it's the node that hands you a spread.
Installing it
Part of the Eden.art nodesuite, under Eden π±. ComfyUI Manager β search "Eden" β install, or:
cd ComfyUI/custom_nodes/
git clone https://github.com/edenartlab/eden_comfy_pipelines.git
cd eden_comfy_pipelines
pip install -r requirements.txt
Restart to load it.
Common issues
The assert that bites: num_style_components can't exceed the number of embeddings in your stack - asking for 6 components from a 4-image library fails with an assertion error, so keep the two in step. Also note min_weight is a floor on individual weights, not a knob for "how much style," so raising it narrows variety more than it strengthens the effect. And because selection is random per run, results aren't seed-reproducible within the node itself - if you want a specific blend on demand, that's what Linear_Combine_IP_Embeds is for. The random node is for exploration; the deterministic one is for decisions.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| style_embeddings | EMBEDS | β | |
| avg_embed_norm | FLOAT | 300.00β500 | β |
| num_samples | INT | 4 | β |
| num_style_components | INT | 4 | β |
| min_weight | FLOAT | 0.200β1 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| pos_embed | EMBEDS | β |
| batch_size | INT | β |