File size: 3,049 Bytes
83d8d6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
license: cc-by-4.0
task_categories:
- text-generation
tags:
- code-based-image-generation
- text-to-image
- javascript
size_categories:
- 10K<n<100K
---

# CIG-SFT-35k

35,000 prompt and program pairs for supervised fine-tuning of code-based image generation. Each program is a JavaScript
`render(stage)` function that draws the prompt in a 512x512 DOM element.

- Prompts: 50% GenEval2-style (17,500), 50% captions from [FLUX-Reason-6M](https://huggingface.co/datasets/LucasFang/FLUX-Reason-6M) (17,500, Apache-2.0).
- Programs: written by GPT-5.6 teachers, Sol 20% (7,000), Terra 30% (10,500), Luna 50% (17,500), with the same split in each prompt source.
- A program is kept if it finishes normally, renders a non-blank image, loads nothing external and fits in 8,192 tokens (prompt plus program).
- FLUX captions whose images are related to PRISM-Bench prompts were left out.

Used to train [CIG-27B-SFT](https://huggingface.co/codeimagegen/CIG-27B-SFT) and the models built on it.

## Files

All files are in `geneval-flux/`.

| file | rows | what |
|---|---|---|
| `train.jsonl` | 35,000 | training set |
| `validation.jsonl` | 191 | held-out validation set, no overlap with train |
| `register.jsonl` | 35,000 | one record per training row: prompt, teacher and the checks it passed |
| `manifest.json` | | counts per source and teacher, and sha256 of the three jsonl files |
| `validation-manifest.json` | | counts and sha256 of `validation.jsonl` |

`train.jsonl` rows:

- `messages`: chat list of `system` (the task instruction), `user` (the prompt) and `assistant` (the program).
- `metadata`: `id`, `source_id`, `teacher`, `family` (`geneval2` or `flux`), `sequence_tokens`, `code_sha256`,
  `image_sha256` (of the rendered image), `source` and `program_directory` (internal generation run and path).

`validation.jsonl` rows have the same `messages`; `metadata` holds `id`, `teacher`, `sft_sequence_tokens` and `code_sha256`.

`register.jsonl` records match `train.jsonl` by `id`. Main fields: `prompt`, `prompt_sha256`, `teacher`, `family`,
`finish_reason`, `code_bytes`, `prompt_tokens`, `completion_tokens_including_eos`, `sft_sequence_tokens`, `fits_8192`,
`external_url_flag`, `embedded_raster_flag`, `blank_gate_pass`, `spatial_rgb_rms_std`, `image_sha256`, `reject_reasons`.

## Download

With the code at https://github.com/codeimagegen/codeimagegen:

```bash
python train/fetch_sft_data.py geneval-flux --repo codeimagegen/CIG-SFT-35k --out data/sft/geneval-flux
```

It downloads `geneval-flux/*` and checks every file's sha256 against the manifest. Or with `huggingface_hub`:

```python
from huggingface_hub import snapshot_download
snapshot_download("codeimagegen/CIG-SFT-35k", repo_type="dataset", allow_patterns=["geneval-flux/*"])
```

## 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}
}
```