Sergio Paniego’s model paints watercolours through editable JavaScript
Sergio Paniego published preference-based training for code-generated watercolours.
The model produces editable JavaScript that paints an image. Sergio Paniego published an open implementation using TRL and OpenEnv to train Qwen3.5-35B-A3B to paint watercolours with the p5.brush library. The original concept comes from Surya Narreddi.
A headless Chromium browser renders each program. The environment checks that sketches compile, use the drawing library and actually apply pigment. It also rejects attempts to manipulate scoring, such as placing text on the canvas.
The reward combines sketch validity, code length, visual comparisons against references and aesthetic preferences estimated by HPSv3. Paniego individually rated a reference pool of 178 model-generated paintings. Changing that pool changes the visual preference supplied to training.
One call cited in the source controls pigment bleeding beyond a shape:
brush.fillBleed(0.25)
Sergio Paniego’s “Training a coding model to paint watercolours with TRL and OpenEnv” links the environment, training scripts and models. The implementation’s drawing vocabulary remains deliberately restricted by its prompt to filled shapes rather than unrestricted library access.