Extensions/ComfyUI-ComputedSliders
ComfyUI Extension

ComfyUI-ComputedSliders

Slider LoRAs computed from the model's activations instead of trained, for Krea 2, MiniMax H3, Qwen Image 2.1 and MOSS Image.

By AEmotionStudio·Created about 18 hours ago·Updated about 12 hours ago· 0
AEmotionStudio/ComfyUI-ComputedSliders
Nodes—
On cloudLocal install
Stars0
Updatedabout 12 hours ago
Readme

ComfyUI-ComputedSliders

Version ComfyUI License Dependencies Status

Write-up • Hugging Face • Where it came from • Quick Start • Sliders • How it works • Results • Nodes • Limits

Slider LoRAs for Krea 2, MiniMax H3, Qwen Image 2.1 and MOSS Image, computed from the model's activations instead of trained. Render prompt pairs that differ by one word, mask the concept with SAM3, record what changes inside the model on the masked tokens, and write that change into a rank-1 LoRA. The LoRA's strength is the slider. Nothing is trained.

Krea 2 hair lightness slider from −2 to +3 The Krea 2 hair slider from −2 to +3 on a prompt and seed held out from everything used to build it. The prompt asks for blonde hair; only the LoRA strength changes. The file is 90 KB.

[!NOTE] This is research, not a replacement for trained sliders. In the two training runs we tried, training did no better than the computed beard slider, but those were short runs on one concept. Well-trained slider LoRAs, built from more data over longer runs, look stronger and cleaner in use, most of all on shape, and we did not benchmark against them. Computed sliders hold up best on colour, light and material, and a new one takes minutes to build. The work is shelved for now; this repo presents what it found.

The full write-up, with interactive charts, every contact sheet and the per-model notes, is the project page.

🧭 Where This Came From

This project grew out of latent cartography, an idea from ComfyUI-ShaderNoiseKSampler: map how controls move a picture, so image generation can be steered with intent instead of by hopping between random seeds. The shader-noise work maps the input, the starting noise and which picture it lands on. This project maps the inside of the model: where a concept such as hair colour is represented, by block and by denoising step, and how to push it.

Along the way it borrowed a question from Sparks of Weight-Space Programming (Takehi et al., 2026): can a model be edited from inside its weights? The method that came out of it is different. No language model reads or writes weights here, and reading the weights on their own did not point to the edit. Each slider is a fixed calculation from the model's own activations: renders, masks and two linear solves.

🚀 Quick Start

Installation

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/AEmotionStudio/ComfyUI-ComputedSliders.git

Restart ComfyUI. No pip install is needed. Building a slider needs ComfyUI's SAM3 nodes and the sam3.1_multiplex_fp16 model; using a ready-made slider needs neither.

Use a ready-made slider

Download a .safetensors file from the v1.0.0 release or from Hugging Face into models/loras, and load it with LoraLoaderModelOnly (or any LoRA loader) on the model it was built for. The strength is the slider: positive moves toward B, negative toward A.

Build your own

Open one of the example workflows, change the two words, the prompt templates and the SAM3 prompt, and queue it. It renders the pairs, records them, fits the slider, saves it to output/loras, and renders a held-out prompt from −2 to +3.

📦 Ready-Made Sliders

Graded on held-out prompts against a random LoRA of the same size. The hair, colour and grade sliders passed; the beards draw beards by eye but do not pass the measured rule, and the foliage slider is weak. The project page has the measurements.

| File | Model | A → B | Use at | | :--- | :--- | :--- | :--- | | krea2_slider_hair_darkbrown-blonde_b21 | Krea 2 | dark brown → blonde hair | −2 to +2 | | krea2_slider_hair_darkbrown-red_b21 | Krea 2 | dark brown → copper-red hair | −2 to +2 | | krea2_slider_sky_clear-overcast_b21 | Krea 2 | clear blue → grey overcast sky | −2 to +1.5 | | krea2_slider_foliage_summer-autumn_b21 | Krea 2 | green summer → autumn trees (weak) | −2 to +2 | | krea2_slider_street_dry-wet_b21 | Krea 2 | dry → rain-soaked street | −2 to +2 | | krea2_slider_grade_cool-warm_b21 | Krea 2 | cool → warm colour grade | −2 to +2 | | krea2_slider_beard_shaven-bearded_b9-21 | Krea 2 | clean-shaven → bearded, 4 blocks | +2 to +3 | | h3_slider_hair_darkbrown-blonde_b44 | MiniMax H3 | dark brown → blonde hair, stills and clips | −2 to +2 | | h3_slider_grade_cool-warm_b44 | MiniMax H3 | cool → warm colour grade | −0.5 to +0.5 | | qwen21_slider_hair_darkbrown-blonde_b10 | Qwen Image 2.1 | dark brown → blonde hair | −2 to +2 | | qwen21_slider_beard_shaven-bearded_b10-24 | Qwen Image 2.1 | clean-shaven → bearded, 4 blocks | +1 to +2 | | qwen21_slider_grade_cool-warm_b10 | Qwen Image 2.1 | cool → warm colour grade | −1 to +1 |

They were built on kromaKrea2_opd, 10Eros_Max_h3_raw_beta7_int8 and qwen_image_2.1_int8_convrot, and the Qwen sliders with its official turbo LoRA. They also work at 25 steps without it. Other finetunes of the same base should work, untested. MOSS Image sliders are not included: none passed.

🔬 How It Works

  1. Render contrast pairs. 24 scene templates, each rendered twice on the same seed: once with A ("dark brown hair"), once with B ("blonde hair"). The same seed keeps the layout aligned, and many scenes average out everything that is not the concept.

  2. Mask the concept. SAM3 marks which image tokens are hair in every picture.

    A training pair with its SAM3 hair and face masks Swapping one word also changed the face, eyes and skin. The edit is computed from hair tokens only, which is how it avoids most of that.

  3. Record and map. Hooks on every block record the masked tokens at every denoising step. Where the pairs agree on the A → B change, the concept is represented there. This is the latent-cartography part: a map of one concept by depth and by time.

    Agreement between pairs by block and denoising step on Krea 2 Hair lightness on Krea 2, over 23 pairs. Early blocks only agree once the picture has started turning blonde, so they read colour already drawn. From block 10 on, the pairs agree from step 0, before any pixel differs. The dashed lines are the blocks tried as edit sites (5, 13 and 21).

  4. Compute the edit. v, the write, is the average B − A change of the masked tokens, divided by the block's MLP gate. u, the key, is a ridge regression from the MLP's hidden values that answers 1 on masked tokens and 0 elsewhere, text and sound included. The LoRA is ΔW = v·uᵀ on the block's MLP output layer (blocks.N.mlp.down on Krea 2, blocks.N.mlp.fc2 on H3, transformer_blocks.N.img_mlp.out on Qwen Image 2.1, layers.N.proj.ffn_down on MOSS Image). For each token the layer's output gains strength × (u·h) × v: u decides how much a token is pushed, v which way.

📊 What We Found

The word changes the person; the slider changes the hair

Typing blonde against the slider On the prompts that name dark brown hair, typing "blonde" instead lightened hair by +31 L* and changed the rest of the picture by 16.6 ΔE. The slider at +2 lightened it by +34 and changed the rest by 9.1, and kept the same woman.

Against its controls

The slider against a random direction and against the same direction without the detector A held-out prompt that never mentions hair. The slider moves hair and beard from black to platinum and keeps the man. A random direction of the same size rewrites the person and the scene. Without the detector u, the same direction becomes an exposure change for the whole picture.

Where in the model matters

The same recipe at blocks 5, 13 and 21 at +3 At +3, block 5 turns the man into an older grey-haired one; block 21 keeps him.

Nine sliders, one recipe

Nine Krea 2 sliders on one picture from −2 to +3 The same recipe with no per-concept tuning, graded by two rules fixed before they ran: the change rises with strength, and the slider beats a random direction on effect and spill. Six pass, two are partial, and the one-block beard fails.

Four models

The hair slider on Krea 2, MiniMax H3, Qwen Image 2.1 and MOSS Image The same held-out prompt and seed on every model; 0 is each model's unedited render. Hair passes on Krea 2, H3 and Qwen Image 2.1. On MOSS the face pales with the hair.

The beard slider across models Shape is the hard part. One block never drew a beard. Spread over four blocks it drew one on 6 of 8 Krea 2 faces at +3 and a full one on Qwen Image 2.1 at +2. H3 mostly adds stubble and scalp hair, and MOSS changes the face.

The colour grade slider across models The newer models take a grade much harder. Krea 2 reaches the whole cool-to-warm change at about ±2; H3 at ±1 and MOSS at ±0.5, and from there the frame floods.

Styles: the look, not the medium

Flash, oil pastel and ukiyo-e sliders against typing the style Style sliders move a picture toward a style's look but never redraw it in the medium: no pastel strokes, no woodblock outlines. Typing the style (right) still does that better. Inside Krea 2, oil pastel and ukiyo-e share most of one photo-to-illustration direction.

In short

  • Works: colour, light and material on things already in the picture: hair lightness and colour, sky, foliage, wet streets, colour grades.
  • Hard: new shapes. A beard needs the edit spread over four early-to-late blocks, and then works on two of four models.
  • Doesn't work: styles as a medium, camera angles, new objects, and finding the edit from the weights alone.
  • Hair lightens faces on every model, by +5 to +30 L* at +2. Typing "blonde" moves faces too, so the link is the model's own.
  • Merging into int8 weights is safe. The stock loaders moved hair as far as bypass mode did, with pictures 0.4/255 to 6/255 apart.

🧩 Nodes

  • Slider Prompt Pairs: templates with {x}, one per line, and two words. Outputs the A and B prompt lists and one seed per template (seed + i).
  • Record Slider Activations: for each pair, renders A and B again exactly as they were rendered, recording on the way. On H3 a pair can be two stills or two clips; a clip needs one mask per decoded frame. It stops with an error if the result differs from the rendered latent, which means the seed, cfg, sampler or sigmas differ from the render.
  • Build Slider LoRA: fits the LoRA from all pairs. Outputs a LORA_MODEL for the stock Load LoRA Model and Save LoRA Weights nodes, a short report, and a map of where the A → B change agrees across pairs, by block and denoising step.

The records stay in ComfyUI's cache, so changing a fit setting refits in seconds.

🗂️ Example Workflows

  • example_workflows/krea2_hair_slider.json builds the hair lightness slider from 24 templates (dark brown → blonde, SAM3 "hair", er_sde and beta57 at 8 steps, cfg 1, 1024²), then renders a held-out prompt at strengths −2 to +3. It needs Krea 2 (kromaKrea2_opd), its text encoder and qwen_image_vae. The Conditioning Krea2 Rebalance nodes come from ComfyUI-ConditioningKrea2Rebalance; bypass them if you don't use it.
  • example_workflows/minimax_h3_hair_slider.json builds the same slider on MiniMax H3 from 1600² stills (er_sde and beta57 at 4 steps, cfg 1, block 44). A String Replace node puts each prompt into H3's prompt layout. SAM3 gets the pictures scaled to 1008², the size it detects at, which keeps its masks small enough to run next to H3 on a 12 GB card. It needs an H3 model (tested with 10Eros_Max_h3_raw_beta7_int8), qwen3vl_32b_minimax_h3_nvfp4_awq and minimax_h3_video_vae_int8_convrot.
  • example_workflows/qwen_image_2.1_hair_slider.json builds the hair slider on Qwen Image 2.1 with the turbo LoRA (euler with the turbo template's 8 sigmas, cfg 1, 1024², block 10), in about 8 minutes. It needs qwen_image_2.1_int8_convrot, Qwen2.1/qwen_image_2.1_turbo_lora_avg_rank_178_bf16, qwen3vl_8b_int8_convrot and qwen_image_2.1_vae_bf16.

All three need sam3.1_multiplex_fp16; the Krea 2 and H3 ones also need RES4LYF for the beta57 scheduler.

For a new slider, change the two words, the templates and the SAM3 prompt. On Krea 2, block 21 gives a one-block slider, the cleanest for colour and light, and 9,13,17,21 spreads the edit over four blocks, which helps concepts that add shape, such as a beard, at some cost in cleanliness. On H3, start with 44; on Qwen Image 2.1, with 10, or 10,15,19,24 for a beard; on MOSS Image, with 37.

🧱 Model Notes

MiniMax H3

Tested on 10Eros_Max_h3_raw_beta7_int8 with hair, beard and a colour grade, each graded on held-out stills and clips against a random LoRA of the same size.

  • Block 44 of 50. Of blocks 16, 23, 30, 37 and 44, block 44 moved hair furthest for the least change elsewhere, whether built from stills or clips.
  • Build from clips for video. A slider built from stills works on stills, but on clips it hazes the frame and changes the sound: a still has only a few audio tokens, so the key never learns to leave the sound alone. Built from 124-frame clips, the hair slider works on both and changes the sound a third as much.
  • Global edits are strong. A colour-grade slider gives the full cool → warm change at strength 1 and floods the frame with colour from ±2. Use it at about ±0.5.
  • Shape stays hard. A beard slider spread over four blocks (16,23,30,37 or 23,30,37,44) adds stubble and scalp hair rather than a beard, as on Krea 2.
  • Loading. The usual loaders merge the slider into int8 weights with stochastic rounding. That moved the hair as far as bypass mode did, with pictures about 4/255 apart.
  • RAM. A queue keeps every decoded clip and its masks, about 1.8 GB per pair at 864×480 and 124 frames, so 24 pairs need about 43 GB. The example builds from stills for that reason.

Qwen Image 2.1

Tested on qwen_image_2.1_int8_convrot with hair, beard and a colour grade, each graded on held-out stills against a random LoRA of the same size. Hair was built both with the official turbo LoRA (euler and its 8 sigmas) and without it (euler, simple, 25 steps); beard and grade were built with it.

  • Block 10 of 32. Of blocks 10, 15, 19, 24 and 28, block 10 moved hair furthest for the least change elsewhere with the turbo LoRA, and block 15, by a small margin, without it.
  • Build with the turbo LoRA. Its hair slider passes. Built at 25 steps, the slider moves hair as far but spills more: a glow around the hair, and clothes that change at ±2. The sliders carry over, and the turbo-built one also spills less at 25 steps than the one built there.
  • Beards grow. Spread over 10,15,19,24, a beard slider gives a short beard at +1 and a full one at +2, closer to a beard than on Krea 2 or H3. From +2 the skin darkens.
  • Grade: a clean cool or warm grade at ±0.5, a strong one at ±1, and a flat wash from ±2.
  • Loading. Merged into the int8 weights, the slider moved the hair as far as in bypass mode, with pictures about 1/255 apart.
  • The recorder switches off Qwen's prefix cache while it records; renders may keep it.

MOSS Image

Tested on kromoss_int8_convrot with the 8-step DMD2 LoRA (er_sde, simple), the same way.

  • Block 37 of 42. Of blocks 13, 20, 26, 31 and 37, block 37 moved hair furthest for the least change elsewhere.
  • Hair moves the person too. The hair is blonde already at +1, but the skin tone and the face move with it: face lightness rises or falls by about 20 L* at ±1, where typing "blonde" leaves it alone. It spills more than a random LoRA.
  • No beard. Over four blocks or at block 37, a beard slider changes the face rather than the beard, and from +2 it cracks the skin.
  • Grade is strong. ±0.25 gives a clean cool or warm grade, ±0.5 the whole change, and from ±1 the frame floods.
  • Loading. Merged, the slider moved the hair as far as in bypass mode, with pictures about 4/255 apart.

⏱️ Cost

On a 12 GB RTX 4070 with 31 GB of RAM:

| Model | Per render | Per recorded pair | 24 pairs | Records per edit block | | :--- | :--- | :--- | :--- | :--- | | Krea 2, 1024² | 11 s | 12 s per recording | 20–25 min | 1.4 GB | | H3 stills, 1600² | 10 s, +5 s to decode and mask | 20 s | about 25 min | 0.75 GB | | H3 clips, 864×480, 124 frames | 35 s, +70 s to decode and mask | 70 s | about 2 h | 0.75 GB | | Qwen Image 2.1, 25 steps | 11 s | 23 s | about 20 min | 3.3 GB | | Qwen Image 2.1, turbo LoRA | 4 s | 8 s | about 8 min | 1.1 GB | | MOSS Image, 8-step LoRA | 3 s | 6 s | about 6 min | 0.7 GB |

⚠️ Limits

  • Krea 2, MiniMax H3, Qwen Image 2.1 and MOSS Image only. H3, Qwen Image 2.1 and MOSS Image were tested at cfg 1.
  • Text-to-image and text-to-video renders: the recorder starts from an empty latent.
  • Samplers that evaluate each step once, such as er_sde or euler.
  • Narrow testing: one checkpoint per model, one or two sampler settings each, and six held-out prompts per concept with one or two seeds each.
  • Contrasts can only strengthen or redirect what the model already knows. A specific face or product it has never seen needs training.
  • Save LoRA Weights writes to output/loras; move the file to models/loras to use it with the usual LoRA loader.

🌱 Grassroots Research & Development

This grew out of personal research and is shelved for now, not finished. Directions it points to, back toward latent cartography:

| Area | Idea | | :--- | :--- | | 🌌 Visual intent engine | "Enhance fabric texture" becomes a contrast pair, and the pair becomes a slider. A library of these is the engine ShaderNoiseKSampler's roadmap describes. | | 🧭 Naming what noise does | The same recording run on shader-noise renders could show which internal directions each noise type pushes, turning pixel distances into named features. | | 📐 Rules instead of sliders | "Whenever X, draw Y": every rose blue, a default hair colour. Krea 2's text path is the natural place for that kind of edit. |

Two kinds of control fall out of this: noise picks which picture the model draws among those it might; a weight edit changes what it draws, for any noise and any prompt.

Prior work

Every ingredient here is published; the combination, a closed-form, per-token-gated rank-1 edit to a diffusion transformer's MLP shipped as a standard LoRA, did not turn up in a few searches. That makes it "not obviously done", not "new". The closest work: Concept Sliders (the same product, trained), ROME (the shape of the edit), Steer2Edit (the closest recipe, for language models) and SHIFT (the closest diffusion work, at inference). The full list is on the project page.

🙏 Acknowledgements

  • The ComfyUI team for the platform, its SAM3 nodes and its LoRA loaders.
  • Takehi et al. for the question in Sparks of Weight-Space Programming, and the authors of the prior work above.
  • The model teams behind Krea 2, MiniMax H3, Qwen Image 2.1 and MOSS Image.
  • Built with Claude Code.

🔗 Connect with Æmotion (Developer)

☕ Support

If you find this research useful and wish to support it:

ko-fi

Starring the repository, sharing it, and sending feedback all help too.

📜 License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.