Surface Streak Mask
Surface Streak Mask runs the weathering downward
- image
- source_mask
- mask
- image
- mask
- surface_streak_info
Rain stains on concrete, oil weeping down a wall, grime running off a windowsill - none of that is a blobby noise mask. It's directional, gravity-driven streaks, and generic grunge maps get it wrong because they have no notion of "down." x1SurfaceStreakMask is the pack's node that does: it takes a texture and produces a streak mask that runs along a chosen direction, anchored at the top of each run and bleeding downward like real leakage. One node, and your weathered building suddenly looks like it's been rained on.
How it works
The mask is built from two ideas working together: where a streak starts and how far it runs. anchor_bias (0.56) decides where the source of the leak is - dark, contrasty spots that grime would cling to before gravity takes it. streak_length (0.62) is the reach: the mask extends downward from each anchor as a falling band, and that length control is what separates a fresh streak (short) from a years-old run-off (long). The direction setting (default down) sets the gravity axis; flip it if your object's orientation in UV space doesn't match "down" on screen, which is the first thing to check when streaks look sideways.
breakup (0.42) adds the drip variation - real streaks waver, fork, and thin out, and this is the knob that keeps them from looking like clean stripes. coverage (0.46) is how much of the surface the streaks claim, contrast (1.25)/gamma (1.0) shape the falloff, and source_mode (combined_streak) picks which image channel drives the analysis.
The inputs that matter
Settings live in a settings_json string, prefilled:
direction(down) - the gravity axis. Check this against your UV orientation first.streak_length(0.62) - how far each streak runs. The character knob.anchor_bias(0.56) - where streaks originate (dark/contrasty seeds).breakup(0.42) - drip variation.coverage(0.46) - how much surface gets streaked.invert_values- flip for a clean streak pattern (the dry paths), useful for masking paint that survived the elements.
Optional source_mask restricts analysis, mask feathers the output. Outputs are image, mask, and surface_streak_info.
Installing it
Part of the MKRShift Nodes pack. ComfyUI Manager: search "MKRShift", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
Restart after. No models - numpy math, runs on CPU.
Gotchas
The two things that actually bite: direction and signal. If your streaks come out sideways or upside down, it's the direction setting fighting your texture's UV layout - rotate to match, don't blame the node. And like all these surface nodes, a flat uniform texture gives it almost nothing to anchor to; it wants a texture with luma or color contrast so anchor_bias has seeds to grab. Feed it the output of the pack's slope/cavity nodes if your albedo is too clean, and the streaks will follow geometry instead of guessing.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| settings_json | STRING | {"source_mode":"combined_streak","direction":"down","streak_length":0.62,"anchor_bias":0.56,"breakup":0.42,"coverage":0.46,"contrast":1.25,"gamma":1.0,"blur_radius":1.0,"invert_values":false,"mask_feather":8.0,"invert_mask":false} | — |
| source_maskopt | MASK | — | |
| maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| surface_streak_info | STRING | — |