/ Модель

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

Лицензия
CC BY-NC-SA 4.0
Библиотека
pytorch
Опубликована
7 ноя 2026

welmia-face-2.0-7.6m-base

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

Компактный генератор в стиле StyleGAN2 создаёт синтетические портреты людей размером 128×128 из случайного шума.

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

Бенчмарки

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

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

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

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

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

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

Welmia Face 2.0 — 7.6M Base — небольшая безусловная модель генерации изображений лиц, разработанная Welmia. Генератор в стиле StyleGAN2 содержит около 7,6 млн параметров и создаёт синтетические человеческие лица размером 128×128 пикселей из случайного шума. Модель обучена с нуля; веса распространяются в формате safetensors и могут запускаться на CPU.

Модель предназначена для генерации портретов для прототипов, творческих проектов и экспериментов. Параметр усечения psi позволяет менять соотношение разнообразия и визуальной аккуратности результатов. Количественная оценка качества не проводилась. Ограничения включают низкое разрешение и возможные искажения деталей, поз и фона; результаты также зависят от смещений обучающих данных. Лицензия CC BY-NC-SA 4.0 разрешает использование с указанием авторства, но не коммерческое использование и требует распространения производных материалов на тех же условиях.

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

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

Ограничения

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

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

🧬 Welmia Face 2.0 — 7.6M Base

A small, 7.6-million-parameter StyleGAN2-style GAN that generates 128×128 human faces from random noise. Trained from scratch, runs on a plain CPU.


✨ Highlights

  • Small: 7,625,453 generator parameters (~30.5 MB, float32).
  • Runs on CPU: about 22 images/second on an Intel Core i5-10400 (no GPU), see Speed for the exact numbers and caveats.
  • StyleGAN2-style generator: mapping network, modulated convolutions with demodulation, per-layer noise inputs, skip-RGB output, no BatchNorm.
  • Quality controls: truncation (psi) to trade diversity for cleaner faces.
  • Safe weights: shipped as safetensors (no pickle, no arbitrary code execution when loading the weights).
  • Reproducible on request: every run prints its seed, so you can regenerate the same faces with --seed.

🚀 Quick Start

1. Install

pip install torch torchvision safetensors pillow numpy

2. Download the repo files into one folder

You need these four files together:

model.safetensors
welmia_gan.py
welmia_cfg.json
generate.py

3. Generate faces

python generate.py                      # 8 random faces (2x4 grid) -> ./inference_output/
python generate.py --num 50             # 50 faces
python generate.py --psi 1.0            # more diverse, less clean
python generate.py --seed 7             # reproducible faces
python generate.py --benchmark          # measure speed on your machine

Every run prints the seed it used. Run python generate.py --seed <that number> (with the same --psi and --num) to get the same faces back.

4. Use it in your own code

import json, sys, torch
from huggingface_hub import snapshot_download
from safetensors.torch import load_file

path = snapshot_download("Welmia/welmia-face-2.0-7.6m-base")
sys.path.insert(0, path)
import welmia_gan as W

cfg = json.load(open(f"{path}/welmia_cfg.json"))
g = W.make_G(cfg)
g.load_state_dict(load_file(f"{path}/model.safetensors"))
g.eval()

with torch.inference_mode():
    z = torch.randn(8, cfg["z_dim"])                 # z_dim = 256
    imgs = g(z, psi=0.7).clamp(-1, 1) * 0.5 + 0.5    # RGB, 0..1, shape [8, 3, 128, 128]

save_image(imgs, "faces.png", nrow=4)                # saves a 2x4 grid
print("Saved faces.png")

welmia_gan.py is normal Python code that gets imported. Read it before running it, as you should with any code you download.


🎛️ Truncation (psi)

psi pulls each face toward the "average" face.

psiEffect
0.5Cleanest and safest, but faces look more similar to each other
0.7Default. Good balance of quality and variety
1.0Full diversity, but more artifacts (warped backgrounds, odd accessories)

Try python generate.py --psi 1.0 to see the difference yourself.


⚡ Speed (measured on one machine)

PropertyValue
CPUIntel Core i5-10400
RAM16 GB
GPU usedNone (CPU only)
Testpython generate.py, 16 faces per run, ψ = 0.7, 5 separate runs
MetricResult
Time per batch of 16693 – 874 ms (median 734 ms)
Time per image43 – 55 ms (median ~46 ms)
Throughput18 – 23 images/s (median ~22 img/s)

Caveats (please read):

  • Each run was a fresh Python process with no warm-up, so it includes first-call overhead. Steady-state speed should be somewhat better, and python generate.py --benchmark measures that.
  • The timing covers the model forward pass only, not saving PNG files.
  • This is one machine. Your numbers will differ with CPU, thread count and PyTorch version.
  • Compared with our earlier 3.6M DCGAN model (welmia-face-1.0-3.6m-base, whose card reports 50+ img/s on the same CPU), this model is roughly 2× slower per image. That is the price of the bigger, better architecture.

📐 Model Details

PropertyValue
TypeStyleGAN2-style generator (unconditional)
Generator parameters7,625,453
File size~30.5 MB (float32, safetensors)
Output128 × 128 RGB, tanh range [-1, 1] in the model, [0, 1] after the rescale shown above
Latent (z) / style (w) size256 / 256
Mapping network4 layers
Channels per resolution4:384, 8:384, 16:256, 32:160, 64:96, 128:48
Weights in this repoEMA (exponential moving average) generator only

The discriminator is not included. It is only needed for training.

Training summary

SettingValue
TrainingFrom scratch, no pre-trained weights
Hardware2 GPUs, distributed data parallel (NCCL gradient all-reduce)
Batch size64 total (32 per GPU)
Learning rate0.002 (Adam, betas 0.0 / 0.99)
LossNon-saturating logistic loss + R1 regularization (gamma 0.25, every 16 steps)
Generator EMA10 kimg half-life
AugmentationRandom horizontal flip
Style mixing probability0.9
DiscriminatorResidual, no normalization layers, minibatch std layer

📊 Evaluation

There is no quantitative evaluation yet. No FID, precision or recall was computed. Quality was judged by looking at samples, so treat any claim of "better than X" as a visual impression and not a measured result.


⚠️ Limitations

  • Low resolution. Output is 128×128. Upscaling it does not add detail.
  • Imperfect details. Backgrounds, hair edges, hats, jewelry, glasses and non-frontal poses can show warping or smearing, especially at psi = 1.0.
  • Dataset bias. The model reflects its training data. Some ages, skin tones, hairstyles, expressions and backgrounds are better represented than others, and output quality can vary across them.
  • Small model. With 7.6M parameters it will not match large production face generators.
  • Single-machine speed numbers. See the speed section above.

🛑 Responsible Use

  • Every face is synthetic. Do not present generated images as photographs of real people.
  • Do not use this model for impersonation, fraud, harassment, disinformation, or to create misleading content.
  • Do not use it for identity verification, biometrics, or any decision that affects real people.
  • Generated faces may by chance resemble a real person.

📜 License

Released under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 (CC BY-NC-SA 4.0).

  • ✅ You may use, share and adapt the model for non-commercial purposes, with attribution to Welmia.
  • 🔁 Anything you build on it must be shared under the same license.
  • ❌ Commercial use is not permitted. The license is non-commercial because the model was trained on data that carries non-commercial terms.

🔗 Links


Made with curiosity, a small GPU budget, and too much coffee. ☕

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

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

GPU в ailist

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

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

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

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

0 моделей