Skip to content

This repository explains how to integrate SwapID and eddie-person-generator in order to perform full-body swaps

Notifications You must be signed in to change notification settings

piktid/swapid-person

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SuperID by PiktID logo

SwapID - Full Body Person Swap by PiktID

SwapID - Full Body Person Swap 1.1.0

Official Website Discord Follow

SwapID - Full Body Person Swap is an advanced GenAI tool designed to perform comprehensive person swapping in images using a revolutionary two-step process that ensures superior skin tone matching and seamless integration.

About

SwapID utilizes a sophisticated two-step approach to achieve the most realistic person swaps possible:

Two-Step Process:

  1. Full Body Generation: The tool first identifies the person in your target image and generates a complete new body that matches the reference person's characteristics, including skin tone, build, and overall appearance.

  2. Face/Head Swap: Using the newly generated body as the base, the tool then performs a precise face or head swap using the same reference image, ensuring perfect skin tone continuity and natural integration.

Key Advantages:

  • Superior Skin Tone Matching: The two-step process ensures perfect skin tone continuity between face and body
  • Cross-Ethnicity Swapping: Successfully swap between people of different ethnicities (e.g., dark skin on light skin photos and vice versa)
  • Natural Integration: The full body generation creates a cohesive base for the final face swap
  • Advanced AI Processing: Leverages cutting-edge generative AI for realistic results

Current Limitations

  • Single Person Images: Currently optimized for images containing only one person
  • Target Person Detection: The tool automatically detects and processes the primary person in the image

Getting Started

The following instructions suppose you have already installed a recent version of Python. To use any PiktID API, an access token is required.

Step 0 - Register here. 10 credits are given for free to all new users.

Step 1 - Clone the SwapID - Full Body Person Swap repository

# Installation commands
$ git clone https://github.com/piktid/swapid-person.git
$ cd swapid-person

Step 2 - Export your email and password as environmental variables

$ export PIKTID_EMAIL={Your email here}
$ export PIKTID_PASSWORD={Your password here}

or the authenticaton tokens - get them in https://studio.piktid.com/profile -> Tokens & Sessions

$ export ACCESS_TOKEN={Your access token}
$ export REFRESH_TOKEN={Your refresh token}

Step 3 - Run the main function with target and reference images

# Using URLs for both target and reference images
$ python3 main_full.py --target_url 'your-target-image-url' --reference_url 'your-reference-image-url' --body

# Using local file paths
$ python3 main_full.py --target_path '/path/to/target/image.jpg' --reference_path '/path/to/reference/image.jpg' --body

# Face-only swap (without full body generation)
$ python3 main_full.py --target_path '/path/to/target/image.jpg' --reference_path '/path/to/reference/image.jpg'

You can customize the generation with advanced parameters:

# Full body swap with custom parameters (e.g. including hair transfer)
$ python3 main_full.py --target_path '/path/to/target.jpg' --reference_path '/path/to/reference.jpg' --body --hair --transfer_hair --seed 12345 --swap_strength 0.55 --person_strength 0.9

Available Parameters

Input Parameters

  • target_path: Local path to the target image file
  • target_url: URL of the target image (used if no target_path provided)
  • reference_path: Local path to the reference image file
  • reference_url: URL of the reference image (used if no reference_path provided)
  • target_name: Target image code name (overrides target_path if provided)
  • reference_name: Reference image code name (overrides reference_path if provided)

Generation Parameters

  • seed: Random seed for reproducible results
  • prompt: Target image description for enhanced generation
  • controlnet_scale: Resemblance with target face (range 0-2)
  • guidance_scale: Generation guidance scale (range 1-20)

Swap Control Parameters

  • --hair: Include hair in the swap (head-swap mode)
  • transfer_hair: Transfer source hair into target (transfer-hair mode)
  • swap_strength: Face similarity level with reference (range 0-1)
  • id_face: Index of the face to swap in target image (default: 0)

Person Edit Parameters

  • --body: Enable full body swap (recommended for best results)
  • person_strength: Similarity with reference person (range 0-1)
  • var_strength: Creativity level in generation (range 0-1)
  • id_person: Index of person to modify in target image (default: 0)

Usage Examples

Basic Full Body Swap

python3 main_full.py --target_path './images/target.jpg' --reference_path './images/reference.jpg' --body

Face-Only Swap

python3 main_full.py --target_path './images/target.jpg' --reference_path './images/reference.jpg'

Advanced Full Body Swap with Hair

python3 main_full.py --target_path './images/target.jpg' --reference_path './images/reference.jpg' --body --hair --swap_strength 0.55 --person_strength 0.9 --controlnet_scale 0.1

Advanced Full Body Swap with Hair Transfer

python3 main_full.py --target_path './images/target.jpg' --reference_path './images/reference.jpg' --body --hair --transfer_hair --swap_strength 0.55 --person_strength 0.9 --controlnet_scale 0.1

Contact

office@piktid.com

About

This repository explains how to integrate SwapID and eddie-person-generator in order to perform full-body swaps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages