FaceBench: teacher selection and distillation data for binary face editing
FaceBench asks which instruction-based image editor makes the best teacher for identity-preserving face edits. It then distills that teacher into small one-step students. This repo holds the data for both stages:
- Teacher selection. Three editors (FLUX.1 Kontext, Qwen-Image-Edit and LLaDA-Image) ran on three CelebA request sets: exact80, binary40 and b40u. Real target photos and blind human grades are included.
- Distillation data. Qwen-Image-Edit, the chosen teacher, edited 1,216 CelebA photos. Each sample keeps the edited image and 8 of the 50 denoising steps, so pixel, latent and trajectory distillation are all possible.
The trained students are in
oloruntobiolutola/facebench-students. That repo
has a ready-to-run inference.py and every training checkpoint.
Result in one line. Qwen-Image-Edit is the best teacher (96% of edits done, 91% done while keeping the person). A 331M one-step SDXS student distilled from it is not significantly different from it in a blind human evaluation (96% / 88%). It is about 1,400× faster.
Contents
| Path | What | Size |
|---|---|---|
g2000_qwen_part{1,2,3,4a,4b,5a,5b}/ |
Distillation data: 1,216 Qwen-Image-Edit edits with teacher trajectories | ~36 GB |
selections/training/ |
Training selection: 2,000 planned requests, the parts, prompt tests, and the train / val split of the 1,216 samples that ran | small |
pilot_exact80_*.zip |
Teacher selection, round 1: 80 fine-grained level requests × 3 teachers | 6 GB |
binary40/*.zip |
Teacher selection, round 2: 40 On/Off requests × 3 teachers (varied wordings) | 3 GB |
b40u_flux/, b40u_qwen/, b40u_llada/ |
Teacher selection, round 3: 40 On/Off requests on unseen people with the generic prompts × 3 teachers | 130 MB |
b40u_students/, b40u_sdxs_base/ |
The same 40 requests edited by the 2 students and by untrained SDXS-512 | 33 MB |
b40u_eval/ |
b40u selection, prompts, human grades and comparison sheets | small |
selections/teacher_selection/ |
The exact80, binary40 and b40u selections | small |
annotations/ |
Blind human grades: binary40 (4 graders, 2 rounds) and b40u (2 graders) | small |
The source photos are from flwrlabs/celeba (aligned, 178×218).
The fine-grained attribute levels (0–5) used to pick requests come from the FaceBench request annotation file
(request_annotated_without_request_mode_bangs.json in the code repository); each request's level is in samples.jsonl
(attr_label for the source, target_score for the target).
The eight edits
Every request switches one attribute between two states. Off is level 0 (for age: 0–1, young), and On is level ≥ 3. The CelebA binary label must agree with the state.
| Edit | Attribute | Direction | Generic prompt (distillation data and b40u) |
|---|---|---|---|
Eyeglasses+ |
Eyeglasses | positive (Off→On) | "Add eyeglasses." |
Eyeglasses- |
Eyeglasses | negative (On→Off) | "Remove the eyeglasses." |
No_Beard+ |
No_Beard (beard) | positive | "Add a beard." |
No_Beard- |
No_Beard (beard) | negative | "Remove the beard." |
Smiling+ |
Smiling | positive | "Make the person smile." |
Smiling- |
Smiling | negative | "Change the facial expression to neutral, not smiling, with the lips closed." |
Young+ |
Young (age) | positive: older | "Make the same person look older, keeping their face shape, gender, hairstyle and background unchanged apart from age." |
Young- |
Young (age) | negative: younger | "Make the same person look like a young adult, keeping their face shape, skin tone, ethnicity, gender, hairstyle, accessories and background unchanged apart from age." |
The prompts were chosen with small prompt tests (selections/training/g_prompt_test*, g_age_test*). The
plain wordings for removing a smile and for both age edits often failed with Qwen, hence the longer prompts.
1. Distillation data (g2000_qwen_part*)
Selection. selections/training/g2000_generic.csv lists 2,000 photos of 1,954 people (50% women), 250 per
edit, with one fixed generic prompt per edit (g2000_generic.requests.json). It was split into 8 balanced parts so
that each could run on a separate free Modal account. Seven parts ran, giving 1,216 samples: 152 per edit.
Parts 5c and 6–8 did not run.
Teacher. Qwen/Qwen-Image-Edit: 50 steps, true CFG 4.0, negative prompt " ", output 928×1120, one fixed seed per sample, run on an H100 (about 52 s per sample).
Split. selections/training/g2000_trained_samples_splits.csv has columns sample_id, image_id, identity, attribute, direction, instruction, run, split.
- 1,098 train / 118 val, split by person (
sha256(str(identity)) % 10 == 0goes to val), so no person is in both. - The b40u evaluation people are not in either split.
Layout of each part:
g2000_qwen_partN/
run.json run settings (selection, seed, image source, model)
samples.jsonl one request per line: sample_id, image_id, identity, instruction, attribute, edit,
score_change_direction, target_state, seed, the 40 CelebA attributes, ...
skipped.jsonl requests that could not run (empty in every part)
sources/<bucket>/<id>.jpg the source photo
models/qwen_image_edit/images/<bucket>/<id>.png the teacher's edit (928x1120)
models/qwen_image_edit/teacher/<bucket>/<id>.safetensors the teacher trajectory (28.5 MB, fp16)
models/qwen_image_edit/records.shard*.jsonl per-sample status, latency, paths (one file per worker)
models/qwen_image_edit/model_config.json, model_info.json the exact pipeline settings
logs/
<bucket> is the first 3 digits of the 6-digit id.
Teacher file, 8 of the 50 steps, evenly spaced (latents are Qwen's packed 2×2 patches: 4,060 tokens × 64 channels = a 116×140×16 latent):
| Key | Shape | Meaning |
|---|---|---|
latents |
[8, 4060, 64] | z_t at the 8 saved steps |
velocity |
[8, 4060, 64] | the guided velocity at those steps: z_next = z_t + (sigma_next − sigma) · velocity |
sigma, sigma_next, timestep, step_index |
[8] | the schedule at those steps |
final_latents |
[4060, 64] | z_0 given to the VAE decoder |
cond_image_latents |
[4060, 64] | the source photo in Qwen's VAE latent space |
cond_text, cond_text_negative |
[~1340, 3584] | the VLM (Qwen2.5-VL) condition for the prompt and the negative prompt |
The file metadata stores the prompt, seed, size, scheduler and call arguments. Checks on every part:
- records are complete;
- image, teacher and source counts match;
- no NaN values;
- the last saved step reproduces
final_latents(relative error about 1.7e-3).
from huggingface_hub import snapshot_download
from safetensors.torch import load_file
import json
root = snapshot_download("oloruntobiolutola/facebench-pilot-r200", repo_type="dataset",
allow_patterns=["g2000_qwen_part1/samples.jsonl", "g2000_qwen_part1/sources/000/*",
"g2000_qwen_part1/models/qwen_image_edit/images/000/*"]) # add teacher/* for trajectories
for line in open(f"{root}/g2000_qwen_part1/samples.jsonl"):
s = json.loads(line) # s["edit"], s["instruction"], s["sample_id"], ...
To download everything (36 GB): hf download oloruntobiolutola/facebench-pilot-r200 --repo-type dataset --include "g2000_qwen_part*/*" --local-dir data/.
2. Teacher selection
Three teachers ran with the same seeds per sample:
| Model | Settings | GPU | s / sample | Output |
|---|---|---|---|---|
| black-forest-labs/FLUX.1-Kontext-dev | 28 steps, guidance 2.5 | L40S | ~36 | 944×1104 |
| Qwen/Qwen-Image-Edit | 50 steps, true CFG 4.0 | H100 | ~53 | 928×1120 |
| inclusionAI/LLaDA-Image | 50 steps, guidance 5.0 | H100 | ~60 | 896×1120 |
Each request has a real target photo: another CelebA photo of the same person in the requested state. It is for reference only and was never shown to the models.
| Round | Files | Requests | Edit definition | Human grades |
|---|---|---|---|---|
| exact80 | pilot_exact80_*.zip |
80 (10 per edit, 40 people from the pilot batch) | change to an exact fine-grained level (0–5) | – |
| binary40 | binary40/*.zip |
40 (5 per edit, 40 people from all of CelebA) | On/Off, 40 different free wordings ("Remove the glasses", "The face can be older", ...) | 4 graders, annotations/binary40_human_grades_round{1,2}.csv |
| b40u | b40u_*/ |
40 (5 per edit, 40 people not in the distillation data) | On/Off, the generic prompts above | 2 graders, annotations/b40u_human_grades.csv |
Run layout (the zips unpack to it, and the b40u_* folders use it directly): index.csv, samples.jsonl,
targets.jsonl, sources/, targets/, models/<model>/images/<bucket>/<id>.png and models/<model>/records*.jsonl.
The index.csv columns are sample_id, identity, instruction, attribute, direction, change, source_level, target_level, original, edited, target, target_image_id, target_photo_level, target_match, teacher, teacher_model, seed, latency_s.
The student folders (b40u_students/<model>/, b40u_sdxs_base/sdxs_base/) contain <bucket>/<id>.png plus
index.csv (sample_id, edit, prompt, student, path, ms) and sources/.
Human evaluation
All grading was blind, on a web page that showed the source, the real target and every model's edit in a random order per sample (letters A–C, or A–F for b40u), at equal size, with model names hidden. Questions per edit:
- change:
right(done),partial,none(not done) orwrong(the opposite edit, or another attribute changed); - same person: 1–5;
- image quality: 1–5;
- per sample, the best edit or none.
CSV columns: grader, sample_id, model, shown_as, instruction, attribute, direction, source_level, target_level, change, same_person, quality, is_best, best_none, graded_at. Graders are pseudonymised as grader_1 to grader_4,
with the same alias for the same person in every file. Round 1 of binary40 is an earlier pass with less consistent
use of the guidelines; use round 2.
Agreement (Krippendorff's α, own implementation checked against Krippendorff's published example):
| Set | Done (nominal) | Change, 4 classes | Same person (ordinal) | Quality (ordinal) |
|---|---|---|---|---|
| binary40 round 2, 4 graders, 120 edits | 0.80 | 0.74 | 0.61 | 0.36 |
| b40u, 2 graders, 240 edits | 0.81 | 0.76 | 0.77 | 0.67 |
Results (mean over graders):
| Model | binary40: done | b40u: done | b40u: done & same person ≥ 4 | b40u: same person | b40u: quality | b40u: picked best |
|---|---|---|---|---|---|---|
| Qwen-Image-Edit | 87% | 96% | 91% | 4.47 | 4.69 | 30% |
| LLaDA-Image | 85% | 86% | 51% | 3.27 | 4.20 | 6% |
| FLUX.1 Kontext | 57% | 70% | 70% | 4.74 | 4.74 | 20% |
| SDXS student (331M, 1 step) | – | 96% | 88% | 4.36 | 4.45 | 29% |
| Pixel student (29M) | – | 56% | 52% | 3.44 | 3.09 | 10% |
| SDXS-512 untrained (zero-shot) | – | 11% | 2% | 1.39 | 1.84 | 1% |
- FLUX.1 Kontext keeps the person because it often does not edit. It leaves age unchanged (0–30% done).
- LLaDA-Image edits, but changes the person.
- Qwen-Image-Edit is the best teacher in both rounds.
- The SDXS student does not differ significantly from Qwen on any b40u measure (paired McNemar / Wilcoxon, Holm-corrected).
The full analyses are the notebooks 03_human_annotation_binary40.ipynb and 04_human_annotation_b40u.ipynb in the
FaceBench code repository.
Cost
- Teacher data: about $105–115 for 1,216 samples, on the free $30 Modal credits of several team members.
- Teacher selection runs: about $10 per round of 40 × 3 teachers.
- Student training: about $1–2 per pixel / latent / flow run (30–90 min on an L4) and $4–5 per SDXS run (100 min on an L40S).
- Total for the project: about $150 across 6 Modal accounts.
Licence and responsible use
Research use only.
- The images derive from CelebA, which is for non-commercial research. Its terms apply to the source photos and to every edit of them.
- The edits were made with Qwen-Image-Edit (Apache 2.0), FLUX.1 Kontext [dev] (FLUX.1 [dev] non-commercial licence) and LLaDA-Image. Their licences apply to their outputs.
- The data shows real (celebrity) faces with synthetic edits. Do not use it to identify people, or to make or pass off misleading images of real people.
Citation
If you use this data, please cite CelebA (Liu et al., "Deep Learning Face Attributes in the Wild", ICCV 2015) and the teacher models (Qwen-Image, FLUX.1 Kontext, LLaDA-Image).
- Downloads last month
- 88