Prompting and chat
Drive the Creative Code node from natural language with the prompt panel, chat history, and model picker.
Prompt mode lets you describe a sketch in words and have an LLM stream the JavaScript into the editor. It's the fastest way to scaffold an idea — start with a sentence, watch it materialize, then drop into code mode when you want hand control.
The prompt panel
Open the Creative Code node and you land in the prompt panel. Type what you want, hit submit, and the model starts writing. Code streams into the editor on the right — line by line, with diff highlights so you can see exactly what's changing as it goes.
The first prompt of a sketch is a generation: the editor goes from empty to the sketch you described. Subsequent prompts are usually edits: "make the circles bounce off the edges," "use a darker palette," "add a slider for the speed." If your editor is empty or holds the default boilerplate, your prompt generates from scratch; if it already has working code, your prompt edits it.
Prompt crafter
Need help structuring a long prompt? Expand the prompt panel into the prompt crafter — a guided UI for describing scenes, behaviors, and constraints. The crafter outputs a final prompt you can review and submit, useful when you're working with a complex brief.
Streaming and editing while it writes
When the model is mid-stream, the editor shows the in-flight code with the new lines highlighted. You can watch it work, and you can stop the generation if it's heading the wrong way — the partial output stays in the editor.
If you submit a follow-up prompt before the current generation finishes, the in-flight stream is canceled and the new prompt takes over. Useful when you realize the direction is wrong three lines in.
Chat history and checkpoints
Every prompt-and-generation pair is recorded in the chat panel. Each generation is a checkpoint — a saved version of the sketch tied to the prompt that produced it. Click a prior message to jump the editor and the canvas back to that version. Submitting a new prompt from a prior version asks you to confirm — the chat then drops the later versions and continues forward from where you jumped back to.
This is your safety net. If a prompt sends the sketch sideways, click back to a working checkpoint and try a different phrasing. Manual saves (covered in Saving and sharing) create their own named checkpoints alongside the auto-generated ones.
The model selector
Three models are available for code generation, picked from the model selector in the prompt panel:
| Model | Strengths |
|---|---|
| Opus 4.7 | Highest quality. Best for complex sketches, intricate behavior, and prompts that require multi-step reasoning. |
| Sonnet 4.6 | Balanced. Faster than Opus with comparable code quality for most sketches. |
| Kimi K2.6 | Cheapest. Good for iteration on simple sketches; lighter on credits. |
Each model has value, speed, and quality dot ratings next to its name — a rough guide, not a hard rule. If a generation feels off, switch models and re-prompt; sometimes the difference is dramatic.
Model choice and credits
Generations cost credits according to the model and the length of the prompt + output. Heavier models cost more per generation. Pick Sonnet by default; reach for Opus when you're stuck or the sketch is genuinely complex.