GNM Expression Sampler
GNM Expression Sampler
- expression
"Happy." "Surprise." "Tongue center." GNMExpressionSampler hands you twenty named expression classes and returns the parameter vector that makes a 3D head perform them. It's the sibling of the Identity Sampler - same decoder architecture, same numpy reimplementation of a Keras model - but where identity controls the shape of the face, this controls its state.
The full menu, straight from the pack: surprise, disgust, suck, compress_face, stretch_face, happy, squint, platysma, blow, funneler, smile_wide, corners_down, pucker, wink_left, wink_right, mouth_left, mouth_right, lips_roll_in, snarl, tongue_center. That's your twenty.
Inputs:
expression- pick one from the list.strength(default 1, 0–3) - 1 is a natural delivery; crank it and the expression gets theatrical.seed- and here's the fun part: same expression, different seed, subtly different face doing it. The seed doesn't change which expression - the class does - it changes the incidental variation, so you can batch a dozen "surprised" heads and keep the one you like.
The output is a single expression (GNM_EXPRESSION) vector for the expression input on GNMHeadRender. Same wiring convention as the identity sampler, and the two slot together cleanly: identity defines who, expression defines how they're feeling.
Mechanically it's the same story as its sibling: a latent z plus a one-hot of the chosen class runs through four dense layers of bundled .h5 weights, executed in numpy via h5py. No TensorFlow anywhere. Same seed, same result as the original tf.keras model - the pack's tests verify the outputs match exactly.
Where you reach for it: any time the expression is the point. If you're generating a head to use as a ControlNet depth/normal condition, this is the node that decides whether the final generated character looks calm, alarmed, or mid-wink - before the diffusion model ever sees it.
Install
ComfyUI Manager is the easy path: Custom Nodes → search "ComfyUI-GNM" → Install, then restart. Or clone by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/soylab-edu/ComfyUI-GNM
cd ComfyUI-GNM
pip install -r requirements.txt
Model data ships in vendor/; no separate download, no TensorFlow.
Common issues
Same as its sibling: an h5py error means the requirements didn't land. And if you're already using the all-in-one GNM Head Viewport node, its expression dropdown wraps this sampler's functionality - you only need the standalone node when you're building the render graph manually and want to mix a chosen expression with a separately sampled identity.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| expression | COMBO | 20 options: surprise, disgust, suck, compress_face, stretch_face, happy, +14 | |
| strength | FLOAT | 1.000–3 | — |
| seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| expression | GNM_EXPRESSION | — |