Nodes/ComfyUI DocRes/DDC Edit Points
ComfyUI Node

DDC Edit Points

The place where you get to argue with the dewarp

By zjkhurry·Created 22 days ago·Updated 21 days ago· 1
DDC Edit Points
  • points
  • points
  • preview
  • image
◄points_json►

Most ComfyUI nodes trade in tensors, and you can't fix a tensor by dragging it. DDC Edit Points is the exception in this pack: it takes the predicted control-point grid, draws it over your page, and lets you drag the points until the page is flat. It runs no network at all, so a correction costs you a mouse movement instead of a forward pass.

That split is deliberate, and it's the reason the three DDC nodes exist as three nodes. Prediction is the expensive part and editing is the cheap part, so the pack puts a human between them.

How the editing works

Open the editor with the edit control points button on the node. What you get is 81 handles on a 9x9 grid - the network predicted 961 points, but nobody is dragging 961 dots, so the editor works on the coarse sample and the full grid is fitted to whatever you do afterwards.

  • drag a handle to move it
  • ctrl/cmd + scroll to zoom, up to 12x
  • scroll, space+drag, middle-drag or right-drag to pan
  • Reset view to snap back, Esc to close

Points you've moved turn yellow, which makes "what did I change" obvious at a glance instead of a guessing game. Correcting a single crease that bends a paragraph is normally three or four drags.

Your drags are written into the node's points_json widget as canvas coordinates with the canvas width and height alongside them. That's a nicer design than it sounds: because the edits live in a widget, they serialise into the workflow, so re-running the graph reproduces the warp exactly and you never have to redo the same drags.

Inputs and outputs

points (DDC_RAW_POINTS, required) - from DDC Predict Points.

points_json - a multiline string, empty by default. You don't type in it. It's where the canvas stores what you dragged.

Three outputs, and the difference between two of them is the single most common mistake with this pack:

  • points (DDC_EDITED_POINTS) - the grid with your edits applied. Goes to DDC Rectify.
  • preview (IMAGE) - the canvas with the dots drawn on it. Fine for a SaveImage if you want a record; never wire it into the warp, or the dots get baked into your flattened page.
  • image (IMAGE) - the same canvas, unmarked. This is the one DDC Rectify wants.

This node is an output node, and that's on purpose. The frontend can't read an IMAGE socket, so the node publishes the image through ComfyUI's ui channel - the same route SaveImage uses - which is also how the marked preview ends up on the node body. That means the editor always has something to draw on without you wiring a preview downstream.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/zjkhurry/comfyui-docres.git
pip install -r comfyui-docres/requirements.txt

Restart, then look under image/DocRes (or install via Manager by searching DocRes). Dependencies are einops, opencv-python, scikit-image, safetensors; only scikit-image is probably new to your environment. This node downloads no weights of its own - it's pure frontend plus JSON.

Where people get burned

You swapped the image and your edits vanished. This one is real and it's silent. The stored drags are only applied when their recorded canvas dimensions match the incoming image's canvas. Feed in a scan of a different size and the node quietly falls back to the unedited grid - no error, no warning, just a page that comes back warped the way it was before. If the corrections seem to have stopped working, check that you're still on the same image.

Wiring preview into DDC Rectify. The dots are actual pixels. They'll be in the output.

The panel doesn't show up. The editor is a custom JS file served by the pack, so after installing or updating you want a hard browser refresh, not just a graph reload. If the button is simply absent, that's the first thing to try.

Trying to skip it. DDC_EDITED_POINTS is produced here and nowhere else, so this node is compulsory in a control-point chain even when your page needs no corrections at all. Cheap node, though - it costs nothing to leave in place and it's the thing that makes a saved workflow reproducible.

Categoryimage/DocRes

Inputs (2)

NameTypeDefaultDescription
pointsDDC_RAW_POINTS—
points_jsonSTRING—

Outputs (3)

NameTypeDescription
pointsDDC_EDITED_POINTS—
previewIMAGE—
imageIMAGE—