---
title: livefaceswap-reference-prep
canonical_url: "https://www.modelscope.cn/studios/ChrisFox/livefaceswap-reference-prep"
md_url: "https://www.modelscope.cn/studios/ChrisFox/livefaceswap-reference-prep.md"
repository: ChrisFox/livefaceswap-reference-prep
chinese_name: "LiveFaceSwap AI Face Swap 参考图预处理"
last_updated: 2026-08-24
sdk_type: streamlit
sdk_version: 6.17.3
downloads: 0
stars: 0
---

# livefaceswap-reference-prep

> livefaceswap-reference-prep - ChrisFox 在 ModelScope 创建的在线 Demo。LiveFaceSwap AI 换脸参考图预处理工具，用于实时 AI 换脸工作流的第一步：上传您拥有或获授权的人像，校正 EXIF 方向，转换为 RGB，通过焦点控制完成方形裁剪，并导出 512、768 或 1024 px PNG，再作为 LiveFaceSwap AI…

ChrisFox/livefaceswap-reference-prep 是 ModelScope 魔搭社区上的在线可交互 Demo（创空间），基于 streamlit 6.17.3 构建，中文名为「LiveFaceSwap AI Face Swap 参考图预处理」。

- **Repository**: ChrisFox/livefaceswap-reference-prep
- **SDK**: streamlit
- **SDK version**: 6.17.3
- **Downloads**: 0
- **Stars**: 0
- **Last updated**: 2026-08-24

Source: https://www.modelscope.cn/studios/ChrisFox/livefaceswap-reference-prep

---

# LiveFaceSwap AI: Face Swap Reference Image Prep

Prepare a portrait reference for a real-time AI face swap workflow before it reaches the face swap model. This free browser tool fixes EXIF orientation, converts the image to RGB, applies an adjustable square crop, and exports a clean 512, 768, or 1024 pixel PNG.

It is useful when a phone photo, webcam capture, or downloaded portrait has the wrong rotation, an off-center face, an unsupported color mode, or inconsistent dimensions. The tool standardizes those technical details so the next step receives a predictable reference image. It does **not** perform face swapping by itself.

[Open LiveFaceSwap AI](https://livefaceswap.ai/) · [View the official source](https://github.com/LiveFaceSwapAI/livefaceswap-reference-prep) · [Install from PyPI](https://pypi.org/project/livefaceswap-reference-prep/)

![Illustrated workflow: authorized portrait, normalized square PNG, then LiveFaceSwap AI](assets/reference-prep-workflow.svg)

## Where this fits in a face swap workflow

1. Choose a portrait you own or are authorized to use.
2. Upload it here and keep the face centered with the horizontal and vertical focus controls.
3. Download the normalized square PNG.
4. Use that PNG as the reference portrait in LiveFaceSwap AI or another compatible, authorized face swap workflow.

The output is deliberately simple: one square RGB PNG with normalized orientation and metadata removed. There is no hidden identity transformation, model training, or face replacement in this preparation step.

## Why prepare the reference image first?

Face swap tools commonly need a reference portrait, but source images arrive in many technical forms. A JPEG can contain an EXIF rotation flag, a PNG can use a non-RGB color mode, and a portrait can place the face far from the center. Sending those files directly into a live workflow adds avoidable variation before the face swap model even begins processing.

This utility makes the input predictable:

- **Orientation normalization:** applies the camera's EXIF rotation correctly.
- **RGB conversion:** removes incompatible palette, grayscale, or alpha-only modes.
- **Adjustable square crop:** lets you move the crop toward the face instead of always using the geometric center.
- **Consistent output size:** exports 512, 768, or 1024 pixels for repeatable downstream use.
- **Clean PNG output:** removes source metadata and produces a portable reference file.

## Choosing a useful portrait

Use a clear, well-lit image where the face is visible and not heavily obstructed. A front-facing or slightly angled portrait is easier to position than a distant full-body photo. If the face is not centered, adjust the focus controls until the preview keeps the head and key facial features inside the square.

Only use portraits you own or have permission to process. Do not use reference images for impersonation, fraud, harassment, or deceptive activity.

## Frequently asked questions

### Does this page perform an AI face swap?

No. It prepares the reference image used by a face swap workflow. The actual real-time face swap happens in a compatible application such as [LiveFaceSwap AI](https://livefaceswap.ai/).

### Does this train or upload a face model?

No. The operation is deterministic image processing: orientation, color conversion, crop, resize, and PNG export.

### Which output size should I choose?

Use 1024 pixels when you want the largest available reference. Choose 512 or 768 when a downstream workflow requires a smaller image or faster transfer.

### What happens to the uploaded photo?

The Studio processes the image to create the downloadable preview. Avoid uploading sensitive images, and only use material you are authorized to process.

## Open-source package

The interactive Studio is a Streamlit wrapper around the MIT-licensed [`livefaceswap-reference-prep`](https://pypi.org/project/livefaceswap-reference-prep/) Python package. The wrapper files in this Studio use the Studio's Apache License 2.0 metadata; the installed preprocessing package remains available under its MIT license.
