Undo recent edits
Reverses the latest edits made through this API (canvas_edit, canvas_arrange): nodes they added are removed, nodes they deleted come back (without their results), and moves, wiring, inputs and names return to how they were. Results are never regenerated. A node someone changed after the edit is left as it is and listed in skipped. Use it when the user says undo, revert or go back, or to fix your own mistake, instead of rebuilding by hand.
/v1/canvas_undocanvas_undoTry it
{
"canvasId": "3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c",
"url": "https://media.fuser.studio/9c2a5d6e7f8a.png",
"undone": 1,
"changedNodes": 1,
"recreated": [
"example recreated"
],
"skipped": [
{
"nodeId": "aB3dE5",
"label": "Prompt"
}
],
"revision": 1
}Example
curl -X POST https://api.fuser.studio/v1/canvas_undo \
-H "x-api-key: $FUSER_API_KEY" \
-H "content-type: application/json" \
-d '{
"canvasId": "3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c"
}'const result = await fuser.canvas.undo({
canvasId: '3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c',
});See the TypeScript SDK.
Input
canvasIdstringrequiredThe canvas id. Pass it to canvas_get, canvas_edit and run_start.
stepsintegerHow many edits to reverse, newest first; default 1. All the edits of one in-app agent turn count as one.
Output
canvasIdstringThe canvas id. Pass it to canvas_get, canvas_edit and run_start.
urlstringundonenumberEdits reversed.
changedNodesnumberrecreatedstring[]Deleted nodes brought back, by name; run them again for results.
revisionnumberThe canvas revision after this call. Pass it as expectedRevision on your next canvas_edit.
Arrange nodes on a canvas
Lay out existing nodes with Fuser's layout instead of working out positions. Without layout it tidies them along their wiring, inputs to the left of what they feed; with layout it puts them in a row, column or grid in nodeIds order. To lay out a board of several blocks (a column of references, a grid of finals), pass blocks in one call instead of one call per block. Without an origin the block stays where the nodes are and slides clear of the nodes around it. canvas_edit already lays out the nodes it adds, so use this only when the user asks to rearrange, line up or tidy nodes, or after resizing nodes that now overlap. Arrange only the nodes the request is about; a whole-canvas re-layout (all) needs the user's explicit request and confirm. For wired nodes leave layout out: tidying keeps each wire short and gives fan-outs room. Rows, columns and grids are for unwired sets (references, finals); a row of nodes wired in sequence or to one shared node runs wires through each other. Keep work flowing left to right: a block sits left of the blocks it feeds (hero shots, then their crops, then videos); stack blocks top to bottom only when they don't feed each other. It changes positions only.
Find node types
Node types a canvas_edit diff may use, with what each is good at, its input ids and its output socket. Call it with no query first: it returns the recommended node for each common job. Search only when none of them fits.