Skip to main content
This page matches SDK 2.0.0. Windows uses the C++ API in the facebetter namespace (facebetter/*.h).
This guide builds the Facebetter C++ desktop demo on Windows. The demo uses GLFW + Dear ImGui + OpenGL 3: live preview on the left, beauty controls on the right.

Requirements

MinGW-w64 also works, but MSVC is recommended.

Step 1: Clone the repository

Step 2: Place the SDK files

Unzip the Windows SDK package and place files under demo/cpp/sdk/:
On desktop, EngineConfig::resource_path must point to the resource.fbd file, not a directory. Example: demo/cpp/sdk/resource/resource.fbd.
SDK packages are on the Download page and in the Dashboard.

Step 3: Configure license

Set app_id / app_key (online v2 auth) or license_token in the demo before you run it. If license_token is non-empty, it takes priority (license token string, {token} JSON, or offline .lic contents). Details: Auth & License.

Step 4: Build

Open a Developer Command Prompt for VS (or PowerShell with the MSVC environment loaded):
After the build, CMake typically:
  • Copies facebetter.dll next to the executable in build/
  • Copies resource/resource.fbd to build/resource/resource.fbd
  • Copies demo.png (if present) to build/resource/demo.png

Step 5: Prepare a preview image (optional)

Place a face photo named demo.png in demo/cpp/:

Step 6: Run

The window shows:
  • Left panel — live beauty-processed preview
  • Right panel — Beauty Control Panel:
    • Basic beauty: smoothing / whitening / rosiness / sharpening
    • Face reshape: 26 reshape params (range [-1.0, 1.0])
    • Body reshape: 7 params (range [0.0, 1.0]; needs resource_body.fbd)
    • Makeup: lipstick / blush / eyeshadow / eyeliner / eyebrow / eyelash / pupil / contour
    • Filter / sticker / virtual background
Click Reset All to zero intensities.

Troubleshooting

Q: “facebetter.dll was not found” at startup
A: Confirm demo/cpp/sdk/lib/facebetter.dll exists, then re-run cmake --build build so CMake copies the DLL next to the executable.
Q: Engine create returns nullptr / license failed
A: Point resource_path at resource.fbd, and set license_token or valid app_id + app_key. See Auth & License.
Q: CMake cannot find Ninja
A: Run winget install Ninja-build.Ninja, or use -G "Visual Studio 17 2022" and --config Release.

Next steps

Implement beauty

Create the engine, set effects, and process frames.

API reference

Full C++ API for Windows.