/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
diffusers
Опубликована
9 авг 2026

Lucy

Генерация изображенийТекст → изображение

Lucy — обученная с нуля безусловная диффузионная модель для генерации экспериментальных портретов лиц размером 128×128 пикселей.

7скачиваний за 30 дней2лайкавеса обновлены9 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Lucy — компактная безусловная диффузионная модель DDPM, разработанная opencerebral и обученная с нуля для генерации цветных портретов лиц размером 128×128 пикселей. Она использует архитектуру UNet2DModel из Diffusers, предсказывает шум и содержит 71,4 млн параметров. Модель обучена на наборе CelebA-faces-cropped-128; репозиторий включает веса в формате safetensors, скрипт обучения и журнал запуска. Для генерации можно использовать DDPM с цепочкой из 1000 шагов или ускоренную выборку DDIM за 50 шагов. Модель не принимает текстовые запросы, метки классов или другие средства управления; результат зависит от начального шума и случайного seed.

Lucy предназначена для обучения, исследований и демонстрации обучения небольших диффузионных моделей. Она создаёт узнаваемые лица с правдоподобной общей структурой и освещением, но изображения могут быть мягкими, фон — размытым, а черты лица — искажёнными или дублированными; качество мелких деталей ограничено. Выход рассчитан только на разрешение 128×128. Обучающий набор смещён по возрасту, тону кожи и другим признакам, поэтому результаты не являются репрезентативной выборкой людей. Модель не предназначена для изображения конкретных реальных людей, идентификации, верификации или наблюдения. Лицензия весов и кода — Apache-2.0, однако обучающие данные CelebA имеют отдельные условия, ограничивающие их некоммерческим исследовательским использованием; для коммерческого применения необходимо учитывать эти условия.

Сценарии применения

  • демонстрация обучения DDPM с нуля
  • генерация случайных портретов для экспериментов
  • изучение ускоренной выборки изображений методом DDIM
  • воспроизведение небольшого эксперимента по обучению диффузионной модели

Ограничения

Модель не поддерживает управление текстом, метками или характеристиками лица; качество мелких деталей ограничено, а часть образцов содержит искажения. Обучение на CelebA воспроизводит смещения набора данных, а его отдельные условия ограничивают использование данных некоммерческими исследованиями.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Lucy

Lucy is a small unconditional denoising diffusion model (DDPM) that generates 128×128 RGB face images. It was trained from scratch — no pretrained initialization, no fine-tuning of an existing checkpoint — on a single consumer GPU (RTX 3060, 12 GB) in under ten hours.

Weights are open: Apache-2.0, safetensors, plus the complete training script and the raw training log used to produce them. Everything needed to reproduce the run is in this repo.

Samples from Lucy


Quick start

pip install diffusers transformers accelerate torch safetensors
from diffusers import DDPMPipeline

pipe = DDPMPipeline.from_pretrained("opencerebral/Lucy").to("cuda")
images = pipe(batch_size=4).images
images[0].save("face.png")

Faster sampling with DDIM

The default DDPM scheduler runs the full 1000-step reverse chain. The samples in this card were generated with DDIM at 50 steps, which is ~20× faster and what the training script itself uses for its periodic previews:

import torch
from diffusers import DDIMPipeline, DDIMScheduler, UNet2DModel

unet = UNet2DModel.from_pretrained("opencerebral/Lucy", subfolder="unet").to("cuda")
sched = DDIMScheduler(num_train_timesteps=1000, beta_schedule="linear")
pipe = DDIMPipeline(unet=unet, scheduler=sched).to("cuda")

images = pipe(batch_size=16, num_inference_steps=50,
              generator=torch.manual_seed(42)).images

The model is unconditional: there is no text prompt, no class label, and no guidance. The only control you have over the output is the initial noise, i.e. the random seed.


Model details

ArchitectureUNet2DModel (diffusers), epsilon-prediction
Parameters71.4 M
Resolution128 × 128, RGB
Conditioningnone (unconditional)
Block channels[128, 128, 256, 256, 512]
Down blocksDownBlock2D ×3, AttnDownBlock2D, DownBlock2D
Up blocksUpBlock2D, AttnUpBlock2D, UpBlock2D ×3
Layers per block2
Attention head dim8 (self-attention at the 16×16 stage and in the mid block)
NormGroupNorm, 32 groups, eps 1e-5
ActivationSiLU
Timestep embeddingpositional
Weights formatsafetensors, fp32 (286 MB)
diffusers version0.39.0

Noise schedule

Linear beta schedule, beta_start = 1e-4, beta_end = 0.02, T = 1000 timesteps, prediction_type = "epsilon", variance_type = "fixed_small", clip_sample = True. Standard DDPM (Ho et al., 2020) settings.

Attention sits at exactly one resolution (the second-to-last downsampling stage, 16×16). That is deliberate: at 128×128 a full-resolution attention map is what blows up memory on a 12 GB card, and a single mid-depth attention stage recovers most of the global coherence — face symmetry, consistent lighting across the image — for very little cost.


Training

Datasettglcourse/CelebA-faces-cropped-128 — 192,469 rows used
Hardware1 × NVIDIA GeForce RTX 3060 (12 GB)
Precisionfp16 AMP (torch.autocast) with GradScaler; TF32 matmul enabled
OptimizerAdamW, lr 1e-4, 500-step linear warmup, constant thereafter
Batch size16 (no gradient accumulation)
Grad clippingglobal norm 1.0
EMAdecay 0.9999, updated every optimizer step; the released weights are the EMA weights
Steps60,000 (≈ 5 epochs)
Wall clock9.54 hours, ~1.75 it/s steady state
Seed42
LossMSE on predicted noise, computed in fp32

Augmentation was resize → center crop to 128 → random horizontal flip → normalize to [-1, 1]. Nothing else.

Loss curve

Training loss over the run, read from training/train.log:

steploss
1000.5997
2000.0715
3000.0467
60,0000.0131

Note that the first logged value is the only large one — DDPM epsilon-loss collapses almost immediately to the ~0.05 range because most sampled timesteps are easy, and the remaining 59,700 steps buy a slow grind from 0.047 down to 0.013. Loss is a poor progress signal here; the sample grids are the real one.

Training progression

training/progress/ contains an EMA sample grid rendered every 3,000 steps (step_0003000.png … step_0060000.png), all from the same fixed seed, so you can watch the same 16 latents resolve from noise into faces over the run.


What's in this repo

model_index.json                 DDPMPipeline definition
unet/                            UNet2DModel config + EMA weights (safetensors)
scheduler/                       DDPMScheduler config
samples/sample_grid.png          16 samples, DDIM 50 steps, seed 42
samples/one_face.png             single 128x128 sample
training/train.py                the full training script
training/run.sh                  the exact launch command for this run
training/train.log               complete stdout of the 60k-step run
training/progress/               EMA previews every 3,000 steps

Reproducing

pip install torch torchvision diffusers datasets accelerate tensorboard
bash training/run.sh          # edit --output_dir first

The script stops at min(--max_train_steps, --max_hours), checkpoints every 20,000 steps keeping the last 2, and writes a ready-to-load DDPMPipeline to <output_dir>/final when it finishes. It supports --resume_from for restarts.

Optimizer-state checkpoints (step_*.pt, ~1.2 GB each) are not included here — they are large and only useful for resuming this specific run. The EMA weights in unet/ are the artifact worth keeping.


Limitations

Be realistic about what a 71M-parameter model trained for 9.5 hours produces:

  • Fidelity. Outputs are recognizably faces with plausible structure, lighting, and hair, but they are soft, and fine detail — teeth, eyes at close range, jewelry, text — is often wrong. Compare the samples above before assuming this is drop-in usable.
  • Backgrounds are mush. CelebA is celebrity photos with wildly varied, cluttered backgrounds. The model has learned "a colorful blur behind a face" and little more.
  • Occasional structural failures. A minority of samples have distorted or doubled features. There is no rejection sampling or guidance to filter these.
  • No control. Unconditional means unconditional. You cannot ask for an age, an expression, a pose, or a style. Seed search is the only lever.
  • Dataset bias. CelebA is a celebrity face dataset and is well documented as skewed in age, skin tone, and attractiveness-as-labeled. Lucy reproduces that skew faithfully. It is not a representative sample of human faces and should not be treated as one.
  • Resolution. Fixed at 128×128. The UNet's sample_size is 128 and it will degrade badly if you ask it for other sizes.

Intended use

Research, education, and demonstration of small-scale from-scratch diffusion training. It is a good teaching artifact: the whole pipeline is one 270-line script, and the log shows exactly what a 60k-step run costs on hardware people actually own.

Not intended for generating imagery of, or presented as, real people. The model was trained on photographs of real individuals; while its outputs are not reconstructions of specific training images, do not use it to imply the depiction of any real person, and do not use it in any identity, verification, or surveillance context.

Licensing

  • Model weights and code in this repo: Apache-2.0.
  • Training data is a separate matter. The weights derive from CelebA, which is released for non-commercial research use only under its original terms. The Apache-2.0 grant here covers what the repo authors can grant; it does not and cannot override upstream dataset terms. If you plan to use Lucy commercially, review the CelebA license yourself first — the honest reading is that a CelebA-derived model inherits that non-commercial restriction.

Citation

DDPM, the method this implements:

@inproceedings{ho2020ddpm,
  title  = {Denoising Diffusion Probabilistic Models},
  author = {Ho, Jonathan and Jain, Ajay and Abbeel, Pieter},
  booktitle = {Advances in Neural Information Processing Systems},
  year   = {2020}
}

This model:

@misc{lucy2026,
  title  = {Lucy: a 71M-parameter unconditional face diffusion model trained from scratch},
  author = {OpenCerebral},
  year   = {2026},
  howpublished = {\url{https://huggingface.co/opencerebral/Lucy}}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · diffusers

Нельзя запустить

Безусловная генерация изображений пока не поддерживается.

Ревизия весов
0688058

0 моделей