Technology
Hugging Face - Blog

Training a coding model to paint watercolours with TRL and OpenEnv

Source Entity

Hugging Face - Blog

September 3, 2026
Training a coding model to paint watercolours with TRL and OpenEnv

Surya Narreddi's viral demonstration of an AI generating watercolor paintings via p5.brush has sparked significant interest in creative coding. The project bridges generative language models with artistic tools, signaling a new frontier in algorithmic art.

The Intersection of Generative AI and Algorithmic Art

On August 23, a compelling demonstration of machine creativity went viral, amassing over 1.5 million views. Surya Narreddi showcased a language model capable of producing intricate, organic-looking watercolor paintings. Unlike traditional image-generation models that rely on diffusion processes or pixel-based generation, this project utilizes a novel approach: the model writes JavaScript code to execute its artistic vision.

The Role of p5.brush in Creative Expression

The technical backbone of this achievement is the p5.brush library, an extension of the popular p5.js framework. By leveraging p5.brush, which adds natural drawing tools and simulating physical media like watercolor to the web-based canvas, the language model can programmatically dictate brush strokes, color blending, and pressure. This shift from pixel-predictive generation to instruction-based execution represents a unique synthesis of engineering and fine arts.

Bridging Engineering and Artistic Intent

What makes this project stand out is the clear delineation of roles between artistic vision and engineering execution. While Narreddi provided the initial inspiration rooted in art and design, the current iteration focuses on reproducing the technical recipe in an open-source format. This collaborative approach underscores a growing trend in the developer community: the desire to demystify 'black box' AI by documenting the specific training methodologies and code implementation behind generative models.

Implications for Future Generative Tools

Although the project is currently in a narrow developmental stage—with initial training focusing on close-up floral compositions—the implications for digital art are profound. By training models to interact with established creative libraries rather than just predicting static images, developers are creating systems that can be integrated into professional design workflows. This allows for 'reproducible' art, where the logic behind a piece is as accessible as the image itself.

Anticipating the Technical Roadmap

As the project progresses, the community is eagerly awaiting a full technical report. The current lack of open artifacts has created a high demand for transparency, and the developer has committed to publishing every piece of the recipe. This open-source commitment is vital for the maturation of AI-assisted art, ensuring that the methodologies behind high-quality, non-diffusion-based generation can be peer-reviewed, improved upon, and scaled by other creators.

Conclusion: The Future of Code-Driven Creativity

The viral success of these watercolor animations highlights a shift in public interest toward AI that mimics physical, human-centric artistic techniques. By moving away from static image generation toward code-driven, procedural art, this project paves the way for a more nuanced interaction between language models and the creative canvas. Follow-up reports on the training architecture will likely provide a benchmark for future experiments in programmatic digital art.

Verification Required?

Read the full report from the primary source

Go to Hugging Face - Blog