Nodes/ComfyUI Layer Style/LayerFilter: Distort Displace
ComfyUI Node Runs on cloud

LayerFilter: Distort Displace

Distort Displace

By chflame163·Created 3 years ago·Updated 5 days ago· 3,113
LayerFilter: Distort Displace
  • image
  • material_image
  • mask
  • image
  • displaced_material
â—„distort_strength50.0â–º
â—„smoothness8â–º
â—„anti_aliasing2â–º
◄shadow_blend_mode▾►
â—„shadow_strength75â–º
◄highlight_blend_mode▾►
â—„highlight_strength30â–º

DistortDisplace is a displacement map filter - the Photoshop "Displace" effect, done properly. It takes your image and a second "material" image, and uses the brightness of that material to physically push your image's pixels around. Bright and dark areas of the material shove pixels in opposite directions, so your image warps to follow the material's contours. This is how you wrap a design onto fabric, print a logo onto a crumpled surface, or make text look like it's carved into stone - the displacement makes flat content conform to a textured shape.

The two image inputs are the heart of it:

  • image - the content you're distorting.
  • material_image - the surface whose shape drives the warp. Think of a photo of wrinkled cloth, a rock face, water, tree bark. Its light-and-dark pattern becomes the displacement field.

Then the controls shape the effect. distort_strength (default 50) is the master dial - how hard the material pushes the pixels; positive and negative push opposite ways. smoothness (default 8) and anti_aliasing (default 2) clean up the result so the warp isn't jagged. And then there's a whole lighting layer: shadow_blend_mode / shadow_strength and highlight_blend_mode / highlight_strength let the material's shadows and highlights get blended back onto your image, so it doesn't just warp - it picks up the surface's lighting too. Those blend modes are the full Photoshop set (multiply, screen, overlay, linear burn, and ~26 more), which is what sells the "actually printed on this surface" illusion rather than just "bent."

You get two outputs: the finished image, and displaced_material - the warped material itself, handy if you want to reuse or inspect the displacement. There's also an optional mask to confine the effect to a region.

Where it fits: realistic compositing and mockups. Putting artwork on clothing, labels on bottles, graffiti on brick, tattoos on skin - anywhere flat content needs to believably sit on a textured, non-flat surface. It's also a creative distortion tool in its own right if you feed it an abstract material and crank the strength.

The thing that makes-or-breaks a result is the material image. High-contrast, clearly-textured materials displace strongly and legibly; flat or noisy materials give mush. And the blend-mode/strength lighting controls are the difference between "warped" and "convincingly printed" - leave them at zero and the piece will look pasted on; use multiply on the shadows and screen on the highlights and it starts to look real. Start with a modest distort_strength and build up; it's easy to shred an image with too much.

Install is the pack standard. Easiest is ComfyUI Manager - search ComfyUI Layer Style (or "LayerStyle"), install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/chflame163/ComfyUI_LayerStyle, then pip install -r requirements.txt from inside the folder using ComfyUI's Python, and restart. On a hosted ComfyUI it's usually preinstalled.

The pack-wide caveat: Layer Style is notorious for import failures - install it, restart, and the whole node set is red or missing. It's rarely the individual node; it's a dependency clash. The pack pulls a heavy stack (transformers, onnxruntime, opencv), and one mismatched version - a stray transformers or tensorflow being the classic offender - takes the entire pack down on import. Fix it by reading the ComfyUI startup log for the traceback (it names the package that failed), reinstalling requirements against ComfyUI's own Python, and using Manager's Try Fix. If DistortDisplace is missing, so is every other LayerStyle node, and that shared import failure is the real problem to solve.

Category😺dzNodes/LayerFilter

Inputs (10)

NameTypeDefaultDescription
imageIMAGE—
material_imageIMAGE—
distort_strengthFLOAT50.0-999–999—
smoothnessINT80–99—
anti_aliasingINT21–16—
shadow_blend_modeCOMBO30 options: linear burn, multiply, normal, dissolve, darken, color burn, +24
shadow_strengthINT750–100—
highlight_blend_modeCOMBO30 options: screen, linear dodge(add), normal, dissolve, darken, multiply, +24
highlight_strengthINT300–100—
maskoptMASK—

Outputs (2)

NameTypeDescription
imageIMAGE—
displaced_materialIMAGE—