Spaces:
Running
Download README.md from CodeImageGen/README: direct link, hf CLI and curl.
- Browser
- Download file 2.99 kB
-
https://huggingface.co/spaces/CodeImageGen/README/resolve/main/README.md
- Command line
-
hf download hf://spaces/CodeImageGen/README/README.md
-
curl -L -o README.md https://huggingface.co/spaces/CodeImageGen/README/resolve/main/README.md
title: README
emoji: πΌοΈ
colorFrom: green
colorTo: gray
sdk: static
pinned: false
Code-based Image Generation: Benchmarking, Baselines, and Improved Rewards
Nicole Wang βΒ·β Zhanhao Liang βΒ·β Xingjian Leng βΒ·β Liang Zheng
Australian National University
π Project Page (coming soon) β π» Code (coming soon) β π Paper (coming soon)
Every image above is a program. In code-based image generation, a language model writes a JavaScript program and a fixed renderer turns it into an image, so every image can be read, edited and redrawn at any resolution.
We post-train Qwen3.8-27B for it with SFT from a mix of GPT teachers, then GRPO. A judge shown both the program and the rendered image (IPR) is a better reward than either alone: +18.0 GenEval2 GM over the base model, against +15.5 for the program alone and +14.3 for the image alone.
Models
| model | base | training | reward |
|---|---|---|---|
| Pictor-27B (released model) | Qwen3.8-27B | SFT + GRPO | image + program |
| Pictor-27B-ablation-IR | Qwen3.8-27B | SFT + GRPO | image |
| Pictor-27B-ablation-PR | Qwen3.8-27B | SFT + GRPO | program |
| Pictor-27B-ablation-avgR | Qwen3.8-27B | SFT + GRPO | mean of image and program |
| Pictor-27B-SFT | Qwen3.8-27B | SFT | |
| Pictor-9B | Qwen3.5-9B | SFT + GRPO | image + program |
| Pictor-9B-SFT | Qwen3.5-9B | SFT |
Dataset: Pictor-SFT-35k, 35k prompt and program pairs.
Usage and training
The code for setup, generating images, training and evaluation is coming soon on GitHub. One prompt to one image:
python -m grpo.t2i.eval.generate_one --model CodeImageGen/Pictor-27B --prompt "a red fox in the snow" --out fox.png
π Citation
@article{wang2026codeimagegen,
title = {Code-based Image Generation: Benchmarking, Baselines, and Improved Rewards},
author = {Wang, Nicole and Liang, Zhanhao and Leng, Xingjian and Zheng, Liang},
journal = {arXiv preprint},
year = {2026}
}