Spaces:
Running on Zero
Running on Zero
Commit History
-
Add pre-commit black formatter and apply initial formatting
Adds .pre-commit-config.yaml pinned to black 24.10.0 and [tool.black] config (line-length=88, target-version=py310) in pyproject.toml. Adds pre-commit to dev dependencies. Runs black --all-files to bring the existing codebase into conformance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>db79f31
-
Remove InsightFace swapper and GFPGAN; use Flux2 as the only swap mode
Drops inswapper_128.onnx, GFPGAN, and the fast-mode pipeline entirely. InsightFace FaceAnalysis is kept for face detection and bbox cropping. Face limit raised from 2 to 8, mode toggle removed from the UI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1311044 -
Add Flux2 Quality mode for selective face swap
Introduces FLUX.2 Klein 9B + BFS-Best-Face-Swap LoRA as an optional Quality backend alongside the existing Fast (InsightFace/inswapper) mode. For each selected face, crops the expanded head region from the target, runs the Flux2 pipeline with the source face, and composites the result back — making Flux2 multi-face-aware for the first time. - pipeline_flux.py: bbox expansion, resize-for-flux, lazy pipeline loader, and run_swap_flux (crop → Flux2 → paste per selected face) - app.py: swap_faces_quality() with @spaces.GPU(duration=300), lazy _flux_pipe global, new hidden #run-quality-btn wired to Gradio - templates/app.html: ⚡ Fast / ✨ Quality toggle in Run panel - wire_outputs.js: swapMode state, updateMode(), Quality guard (max 2 faces), clickGradioRunBtn() routes to correct hidden button - app.css: mode toggle styles, .app-badge.flux, quality-warning - requirements.txt / pyproject.toml: add diffusers (git), peft, transformers, accelerate; pin onnxruntime<1.21 for local dev C…81fb298
-
Add inference logging to HuggingFace dataset
Logs each swap (target, sources, result, indices, duration, success/error) as a Parquet row to a private HF dataset via a daemon thread so it never blocks the response. Prunes files older than LOG_MAX_DAYS and squashes repo history once per day. Skips silently when HF_TOKEN / LOG_DATASET_REPO are unset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>c4cb115