A LoRA adapter for Qwen3-8B, trained with RL to write p5.brush JavaScript that paints loose watercolour flowers. A reproduction, at small scale, of Hugging Face's train to paint with code recipe, on a dense 8B model and 2× H100 instead of a 35B MoE.
Part of reipaint (v1 flowers · v2 cats from scratch · v3 the cat kit).
24 held-out pairs (8 flower prompts × 3 seeds; half the flowers never seen in training), same seeds for base and adapter:
| Base Qwen3-8B | After 20 RL updates | |
|---|---|---|
| Mean reward | 0.060 | 0.424 |
| Valid code | 10 / 24 | 23 / 24 |
| Paired wins | 22 / 24 |
Two honest caveats: the evaluation score is the training reward (HPSv3), and the model converged on one composition (entropy 0.077 → 0.027).
0.05 + 0.05 · length + 0.90 · sigmoid(HPSv3 μ / 4)
for "a loose watercolour painting of "; rejected code scores 0.Load like any PEFT adapter on Qwen/Qwen3-8B (revision b968826d9c46dd6066d109eabc6255188de91218), apply the chat template with
enable_thinking=False, sample at temperature 1, and render the code with p5.js 2.3.2 and
p5.brush 2.2.1 on a 600 × 600 WEBGL canvas, in a sandbox.
Return only JavaScript for a loose watercolour painting of a peach hibiscus. Define setup() and draw(). In setup call createCanvas(600,600,WEBGL), angleMode(DEGREES), brush.scaleBrushes(3), noLoop(). In draw translate (-width/2,-height/2) and background('#fff4df'). Paint with brush only. Allowed brush methods: scaleBrushes, noStroke, fill, noFill, fillBleed, fillTexture, beginShape, vertex, endShape, circle. Code rules: use only let/const numbers and strings, for loops, if, arithmetic, your own helper functions, sin(), cos(), random() and Math functions (Math.PI, Math.sqrt, ...). No arrays, objects, push/pop/rotate or other p5 functions. No text, images, pixels, DOM, networking or external assets. `brush` is the p5.brush library and is already loaded as a global: never declare, define or assign `brush` or any other p5 name; just call its methods, e.g. brush.fill('#e8907a', 140) or brush.circle(300, 300, 80). Return exactly one ```javascript code block and nothing else. The shape of a valid answer (a single blob; yours must paint the whole flower with many layered petals):
```javascript
function setup() {
createCanvas(600, 600, WEBGL);
angleMode(DEGREES);
brush.scaleBrushes(3);
noLoop();
}
function draw() {
translate(-width / 2, -height / 2);
background('#fff4df');
brush.noStroke();
brush.fill('#ef9a82', 120);
brush.fillBleed(0.2);
brush.fillTexture(0.2, 0.3);
brush.circle(300, 300, 140);
}
```
Qwen/Qwen3-8B