Training Qwen with RL to Paint Watercolors via Code
zsakib_ · x · 2026-08-24
Surya Narreddy demonstrated using Reinforcement Learning to fine-tune Qwen 3.5 35B to generate watercolor paintings by writing p5.js code, rather than generating images directly.
How it works:
- The model receives a prompt and writes a complete p5.brush JavaScript sketch.
- The code is rendered as a PNG in a sandboxed Puppeteer environment.
- A judge model compares the output against hand-rated reference paintings.
- The judgment is converted into a reward signal, updating the model via GRPO.
Reward Checks:
- Code compilation status.
- Code length.
- HPSv3 preference scores (model-judged preference).
- Human pairwise ratings from hand-picked sketches.
This approach makes the generated image editable code, addressing the limitation of traditional generative models where outputs cannot be directly modified.
Related event: RL-Trained Coding Model Paints Watercolors with JavaScript(3 posts)→
More from coding & agent
- Plannator releases skills to generate HTML wireframes and interactive prototypes for agents — tom_doerr · 2026-08-24
- DocketBird MCP Server: Search and Download Court Documents — modelcontextprotocol · 2026-08-24
- AgentLux MCP Server: Hosted Server for Marketplace and Social Flows — modelcontextprotocol · 2026-08-24
- MongoDB releases toolkit to turn coding agents into database experts — TheTuringPost · 2026-08-24
- Let your agent search for open source projects before coding, 99% of the time it's the right move — generativist · 2026-08-24
- Dev bottleneck isn't AI context limits, it's human cognitive load — Vidhrohi · 2026-08-24