RL-Trained Qwen Coding Model Paints Watercolors by Writing p5.js Code
Developer Surya Narreddy fine-tuned a Qwen 3.5 35B coding model with reinforcement learning at Prime Intellect Lab, enabling it to paint watercolors by writing complete p5.js (p5.brush) JavaScript code rather than generating fixed pixels. The demo spread widely across the community from Aug 24, and because the output is editable code, users can deeply modify details without re-prompting, making it a new direction for AI art.
Confirmed
- The model receives a prompt, writes full p5.brush JavaScript code, and the code is run to render the painting, trained via a four-step loop
- The output is code rather than fixed pixels; users can edit it directly to fine-tune image details and control the final work
- @markk framed it as a new direction for AI art, highlighting editability and workflow advantages
- @itsOmSarraf noted the demo sparked discussion about whether RL can give a model "taste"
- @round saw it as a continuation of the Enfantines artistic vision, combining LLMs with generative art tools
- @GregCook2011 observed the paintings show varied techniques while preserving overall mood, calling it a powerful automated creation tool
- @nptacek joked the approach could be pushed toward "ultra-high-res 16K texture atlases"
- @floguo noted an old post "You can just RL a coding model to paint with JavaScript" resurfaced, bringing more recognition to the creative coding library p5.js
Why it matters
- It transfers code-generation capability to visual creation, demonstrating generalization to unexpected tasks (@himanshustwts)
- Compared with pixel-level image generation, code-based generation offers an editable, controllable workflow; @teortaxesTex called it an interesting path for cross-modal generation
2026-08-24 ~ 2026-08-25 · 11 related posts
Primary sources
- Coding model paints with JavaScript via RL — himanshustwts · 2026-08-24
- [source] Training Qwen with RL to Paint Watercolors via Code — zsakib_ · 2026-08-24
- RL coding model to paint with JavaScript — teortaxesTex · 2026-08-24
- [source] Dev trains RL coding model to paint with JavaScript — xeophon · 2026-08-24
- [source] AI Art Direction: RL-Trained Model Paints by Writing JavaScript Code — mark_k · 2026-08-24
- Can RL train a coding model to paint? Debate on RL vs. Taste — itsOmSarraf_ · 2026-08-24
- Dev demo shows RL-trained coding model painting with JavaScript library p5.brush — round · 2026-08-25
- Training AI to Paint with Code via Reinforcement Learning — kastnerkyle · 2026-08-25
- RL-Trained Coding Model Paints with JavaScript — GregCook2011 · 2026-08-25
- You can RL a coding model to paint with JavaScript — and people want 16K texture atlases — nptacek · 2026-08-25
- RL-trained coding model painting in p5.js goes viral as the library gets its flowers — floguo · 2026-08-25