Spaces:
Running
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
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 Wang  <b>·</b>  | |
| Zhanhao Liang  <b>·</b>  | |
| <a href="https://scholar.google.com.au/citations?user=GQzvqS4AAAAJ" target="_blank">Xingjian Leng</a>  <b>·</b>  | |
| <a href="https://zheng-lab-anu.github.io/" target="_blank">Liang Zheng</a> | |
| </p> | |
| <p align="center">Australian National University</p> | |
| <p align="center"> | |
| 🌐 Project Page (coming soon)   | |
| 💻 Code (coming soon)   | |
| 📃 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} | |
| } | |
| ``` | |