Developers Experiment with Reinforcement Learning to Train AI to Draw with Code, Producing Editable Art
A personal project demonstrates a new way to train LLMs to create artwork that users can later modify through code.
The AI industry is exploring ways to make image creation more flexible. In March 2026, Surya Narreddi and Cameron Franz unveiled an intriguing personal project called "Training AI to Paint with Code," which uses Reinforcement Learning (RL) to train a language model (LLM) to create art by writing code instead of relying solely on prompts.
At the heart of the experiment is the JavaScript library `p5.brush`, which lets the model produce drawings as program code. The goal is to overcome a limitation of conventional AI image generators: users cannot directly edit specific details and must regenerate the entire image to make changes. This approach instead produces "editable" work, allowing people to modify the code and refine the image as needed.
Independent tech outlet DigiNews published a deeper analysis of the project on August 23, 2026. It then became a topic of discussion and drew attention on Hacker News on August 24–25, highlighting developers’ efforts to make AI-generated work easier to control, extend, and adapt for practical use.
It points to a new direction for AI art: rather than producing a one-off image that cannot be directly edited, code becomes a shared medium through which people and AI can collaborate and iteratively refine the work.