Spaces:
Running

README / README.md
nicolecello's picture
dataset renamed to Pictor-SFT-35k
17f0fb6 verified
|
Raw History Blame Contribute Delete
2.99 kB
---
title: README
emoji: 🖼️
colorFrom: green
colorTo: gray
sdk: static
pinned: false
---
<h1 align="center">Code-based Image Generation: Benchmarking, Baselines, and Improved Rewards</h1>
<p align="center">
Nicole&nbsp;Wang &ensp;<b>&middot;</b>&ensp;
Zhanhao&nbsp;Liang &ensp;<b>&middot;</b>&ensp;
<a href="https://scholar.google.com.au/citations?user=GQzvqS4AAAAJ" target="_blank">Xingjian&nbsp;Leng</a> &ensp;<b>&middot;</b>&ensp;
<a href="https://zheng-lab-anu.github.io/" target="_blank">Liang&nbsp;Zheng</a>
</p>
<p align="center">Australian National University</p>
<p align="center">
🌐 Project Page (coming soon) &ensp;
💻 Code (coming soon) &ensp;
📃 Paper (coming soon)
</p>
<p align="center">
<img src="https://huggingface.co/spaces/CodeImageGen/README/resolve/main/assets/teaser.png" width="75%" alt="Images generated by our model. Every image is a program.">
</p>
---
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](https://huggingface.co/CodeImageGen/Pictor-27B) (released model) | Qwen3.8-27B | SFT + GRPO | image + program |
| [Pictor-27B-ablation-IR](https://huggingface.co/CodeImageGen/Pictor-27B-ablation-IR) | Qwen3.8-27B | SFT + GRPO | image |
| [Pictor-27B-ablation-PR](https://huggingface.co/CodeImageGen/Pictor-27B-ablation-PR) | Qwen3.8-27B | SFT + GRPO | program |
| [Pictor-27B-ablation-avgR](https://huggingface.co/CodeImageGen/Pictor-27B-ablation-avgR) | Qwen3.8-27B | SFT + GRPO | mean of image and program |
| [Pictor-27B-SFT](https://huggingface.co/CodeImageGen/Pictor-27B-SFT) | Qwen3.8-27B | SFT | |
| [Pictor-9B](https://huggingface.co/CodeImageGen/Pictor-9B) | Qwen3.5-9B | SFT + GRPO | image + program |
| [Pictor-9B-SFT](https://huggingface.co/CodeImageGen/Pictor-9B-SFT) | Qwen3.5-9B | SFT | |
Dataset: [Pictor-SFT-35k](https://huggingface.co/datasets/CodeImageGen/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
```bibtex
@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}
}
```