There is a project published by Surya Narreddi in which a language model writes JavaScript using the p5.brush library to paint watercolors. A video of this project has recorded over 1.5 million views.
Attempting to Reproduce a JavaScript-based Watercolor Generation Model Using TRL and OpenEnv
This article is a translation. Read the Japanese original
According to an article published on the Hugging Face blog, the developer is attempting to reproduce this project using TRL and OpenEnv. The reference dataset, the environment for reinforcement learning (RL), the training scripts, and the pre-trained models have all been made publicly available.
The entire pipeline can be executed end-to-end on Hugging Face. By preparing the environment and the scorer model and executing specific commands, training can be performed using models such as Qwen/Qwen3.5-35B-A3B.
This model generates images by writing approximately 150 lines of JavaScript code. Since the model's output is code, a key feature is that the decision process for each brushstroke is visualized. Additionally, a specific painting style is achieved by limiting the library methods to 10 types.
Source: Training a coding model to paint watercolours with TRL and OpenEnv (Hugging Face Blog, 2026-09-03)