Parameters and inputs
Declare tunable controls with @fuser-params and connectable input sockets with @fuser-attachments.
Hard-coded constants are fine for one-shot sketches. For anything you'll iterate on, declare a parameter — the value moves out of the source code and onto a live control on the node, so you can tune it without touching the editor.
The Creative Code node has two magic-comment blocks for this:
@fuser-paramsdeclares tunable controls — sliders, color pickers, toggles — that live in a panel on the node.@fuser-attachmentsdeclares connectable input sockets that pull image, video, audio, mesh, or text data from upstream nodes.
The two are separate. Params are panel-only; attachments are how other nodes feed your sketch.
The @fuser-params block
Declare parameters in a magic-comment block at the top of your sketch:
// @fuser-params
// @param speed: number(0, 10, 0.1) = 5
// @param backgroundColor: color = #1a1a2e
// @param label: text = "Hello World"
// @param showGrid: boolean = true
// @end-fuser-paramsThe block must open with // @fuser-params and close with // @end-fuser-params. Each // @param line declares one parameter:
| Type | Syntax | Renders as |
|---|---|---|
number | number(min, max, step) = default | A slider |
color | color = #hexcolor | A color picker |
text | text = "default" | A text field |
boolean | boolean = true | A toggle |
Access the values inside your sketch as the params global:
function draw() {
const { speed, backgroundColor, showGrid } = params;
background(backgroundColor);
if (showGrid) drawGrid();
for (const dot of dots) dot.x += speed;
}The parameters panel
Every declared parameter appears as a control in the parameters panel on the node. Drag the slider, pick the color, flip the toggle — the sketch re-runs with the new value immediately. No re-prompt, no editor round-trip.
When you tweak a control, Fuser writes the new value back into your sketch as the parameter's default — so when you re-prompt or share the sketch, the tuned value is what travels with it. You can always edit the default by hand in the editor.
If you want a value to be driven by another node in your flow instead of by the panel, declare it as an attachment — that's the connectable side of the Creative Code node.
The @fuser-attachments block
Attachments are how upstream nodes feed your sketch. Declare them in a second magic-comment block:
// @fuser-attachments
// @attachment input: image = "Background image"
// @attachment soundtrack: audio = "Audio track to visualize"
// @end-fuser-attachmentsEach // @attachment line creates a connectable input socket on the node. Connect a compatible upstream node, and the value lands in your sketch as the attachments global, keyed by the name you declared:
function draw() {
const { input } = attachments;
if (input) {
image(input, 0, 0, width, height);
}
}The optional description in quotes becomes the socket's label on the node.
Supported attachment types
| Type | Accepts | Use for |
|---|---|---|
image | A single image URL | Textures, backgrounds, source frames |
multiimage | Up to 10 image URLs | Grids, montages, batch processing |
video | A video URL | Playback, frame sampling, motion input |
audio | An audio URL | Reactive visuals, waveforms, beat detection |
mesh | A 3D mesh asset | Models to render in Three.js or pixi sketches |
text | A text string | Captions, prompts, upstream LLM output |
This is how you compose Creative Code into a larger flow. A generation node feeds an image attachment; a transcription node feeds a text attachment; a different sketch's output drives this one.
See the canvas for the socket-and-edge model that ties it all together.
Per-video webcam toggle
For video attachments specifically, each socket has a webcam toggle. Flip it on and the attachment becomes the user's webcam feed instead of whatever's wired into the socket. Useful for camera-driven sketches, real-time feedback, and prototyping.
The browser asks for camera permission the first time you flip the toggle on. If permission is denied, the attachment falls back to the connected upstream — or to nothing, if nothing's connected.
Params live in your sketch source
The @fuser-params block is part of your code. If you re-prompt and ask the model to "remove all the parameters" — or just to "rewrite this sketch from scratch" — the block can disappear with everything else. You'll lose the controls until you re-declare them. Use chat history checkpoints (see Prompting and chat) to recover a working version with the params intact.
Forking a sketch
Every Creative Code node has a special Code In input socket. Connect another Creative Code node's output to it and the downstream node forks the upstream sketch — it inherits the code, the version history, and the chat as starting points. From there the two diverge: changes you make to the downstream sketch don't propagate back, and the upstream's later changes don't pull through unless you reconnect.
Use forking to:
- Branch a sketch you like into variants without losing the original.
- Hand off a sketch to a teammate's part of the canvas while keeping your working copy intact.
- Share an entire prompt history along with the code, so the next person can keep iterating in chat instead of starting cold.