◉ Pulse
xcc3641 avatar
#34 today ▲ 52

xcc3641/blinkface

HTML AI

Gesture viewfinder + real-time AI face restyle with FLUX.2 klein

Created Jul 24, 2026
Stars
28
Today
+5
Forks
3
Quality
90/100
Momentum
39

README

Fetched from GitHub on Oct 30, 2026, 11:07 PM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to xcc3641/blinkface and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

blinkface

Changing your face in the blink of an eye with AI.

中文文档

Gesture viewfinder + real-time AI restyle. One CUDA GPU runs a FLUX.2 [klein] 4B image API; Mac / browser act as the remote: text-to-image, image-to-image, and a two-hand frame for live styled preview.

Preview

blinkface demo — hands frame the face, anime restyle inside

Frame your face with both hands → the region restyles live (anime, Ghibli, cyberpunk, …). Close the frame to jump to the next style.

▶️ Demo video (X / Twitter)

Credits

Components

  • GPU: server.py (FastAPI + diffusers)
  • CLI: gen.py (stdlib only)
  • Web: web/ + web-serve.py (static page + same-origin proxy)
  • Network: Tailscale / LAN / SSH tunnel — no private addresses in the repo

License
Code: MIT
Default model FLUX.2 [klein] 4B: Apache-2.0 (commercial use OK)
If you set BLINKFACE_MODEL to another weight, that model card’s license applies (some FLUX variants are Non-Commercial).
Follow Black Forest Labs / the model card Acceptable Use policy.

Usage boundary
Only process your own image or people who explicitly consented. Do not use for unauthorized face-swap, impersonation, or anything illegal. Style names (Ghibli, Pixar, …) are descriptive prompt words only — no affiliation with rightsholders.


Requirements

Role Needs
GPU server Python ≥ 3.10, CUDA GPU, ≥ 16GB VRAM recommended
Client Python ≥ 3.10, no third-party deps
Frontend Modern browser; camera needs HTTPS or localhost

Config

cp .env.example .env
Variable Used by Meaning
BLINKFACE_HOST gen.py / web-serve.py / restart.sh API base URL
BLINKFACE_BIND / BLINKFACE_PORT server.py default 127.0.0.1:8000
BLINKFACE_TOKEN all three optional shared secret
BLINKFACE_SSH_* / BLINKFACE_REMOTE_* restart.sh remote restart (optional)
HF_TOKEN / HF_HOME dl.py / first model pull Hugging Face

Existing environment variables win over .env. .env is gitignored.


1. GPU server

python -m venv .venv
# Windows: .venv\Scripts\activate
source .venv/bin/activate

pip install torch --index-url https://download.pytorch.org/whl/cu124   # match your CUDA
pip install -r requirements-server.txt
# if your pip diffusers build lacks FLUX.2-klein:
pip install git+https://github.com/huggingface/diffusers.git

# optional pre-download
python dl.py

python server.py
# ready. then:
curl http://127.0.0.1:8000/

On Windows, only open the port you need (e.g. 8000) in the firewall — no need to disable it.

For cross-device access:

# .env
BLINKFACE_BIND=0.0.0.0
BLINKFACE_TOKEN=replace-with-a-long-random-string

Security

  • Do not DNAT / expose the GPU port to the public internet.
  • Default bind is localhost; without BLINKFACE_TOKEN, do not set BLINKFACE_BIND=0.0.0.0 on untrusted networks.
  • web-serve.py injects the token upstream: BLINKFACE_WEB_BIND=0.0.0.0 exposes an unauthenticated generate entry to anyone who can reach that port.
  • Details: SECURITY.md.

2. CLI

cp .env.example .env
# BLINKFACE_HOST=http://<gpu-reachable-host>:8000
# BLINKFACE_TOKEN=…   # if the server requires it

curl "$BLINKFACE_HOST/" 

python3 gen.py "a cat holding a sign that says hello world" cat.jpg
python3 gen.py "Transform this person into a Japanese anime character..." out.jpg --img face.jpg

More style prompts: prompts.md.


3. Web viewfinder

python3 web-serve.py        # default 127.0.0.1:8080, proxies to BLINKFACE_HOST
open http://127.0.0.1:8080
  • Browser only hits same-origin /generate and /health; the proxy injects the token (browser never holds the secret).
  • Remote camera: put an HTTPS reverse proxy in front (e.g. tailscale serve --bg 8080).
  • To let others on the LAN open the page: BLINKFACE_WEB_BIND=0.0.0.0 python3 web-serve.py (see Security — this exposes the free generate entry).
  • Frontend loads scripts/models from jsDelivr / Google Fonts / MediaPipe CDN by default; fully offline needs your own mirrors.

Speed (4090 + klein 4B)

  • 1024px / 4 steps ≈ ~1s
  • Web defaults to 672×384, 2 steps — tuned for live preview

Layout

Path Role
server.py GPU image API
gen.py CLI
web-serve.py + web/ frontend + same-origin proxy
dl.py resilient model download
restart.sh optional: SSH-restart service on a remote Windows GPU host (PowerShell)
prompts.md style prompts
envfile.py .env loader
.env.example config template
SECURITY.md security notes
docs/ README preview images
README-zh.md Chinese docs

License

  • Code: MIT
  • Default model weights (FLUX.2 [klein] 4B): Apache-2.0
  • Other models via BLINKFACE_MODEL: see that model’s card (separate from this repo’s code license)
Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 24, 2026

first spotted on the list

Best rank

#4

highest position reached

Appearances

3

times on the trending list

Quality score

90

out of 100

Momentum

39

trend strength indicator

Star velocity

0.29

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot
1618202224262830xcc3641/blinkface · Jul 24, 7 PM UTC: 19 starsxcc3641/blinkface · Jul 25, 2 AM UTC: 23 starsxcc3641/blinkface · Jul 25, 8 AM UTC: 28 stars7 PM1 AM8 AM

Rank history

position on trending · lower is better
#1#10#20#30#40#50#60Jul 24, 7 PM UTC: rank #4Jul 25, 2 AM UTC: rank #60Jul 25, 8 AM UTC: rank #347 PM1 AM8 AM

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/xcc3641/blinkface" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="xcc3641/blinkface — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

xcc3641/blinkface stars badge
Markdown
[![xcc3641/blinkface](https://www.notionpulse.cc/api/badge/xcc3641/blinkface.svg)](https://www.notionpulse.cc/repo/xcc3641/blinkface)
HTML
<a href="https://www.notionpulse.cc/repo/xcc3641/blinkface"><img src="https://www.notionpulse.cc/api/badge/xcc3641/blinkface.svg" alt="xcc3641/blinkface stars badge" /></a>

Repository of the Day

#4 Repository of the Day

Repository of the Week

#4 Repository of the Week

Repository of the Month

#4 Repository of the Month