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 Qwen Coding Model Paints Watercolors by Writing p5.js Code(11 posts)→
More from coding & agent
- YC F26's Praxis launches AI agents to run law firm ops end to end — ycombinator · 2026-10-16
- Developer builds inter-agent messaging for his AI agents — complete with message undo — baditaflorin · 2026-10-16
- iOS 'dots' workflow: one Siri command turns screenshots into a background shopping and saving agent — nickbaumann_ · 2026-10-16
- Your widget tree is already a list of options: where Jev fits in Flutter — rseroter · 2026-10-16
- How OpenAI's Codex went from failed side project to 40M weekly users in under a year — danshipper · 2026-10-16
- Photon 2.0 launches unified messaging API for AI agents across iMessage and more — Scobleizer · 2026-10-16