Software Description
This software replaces the background of 'aligned' face images and adds lighting effects that match the new background. Unlike methods that use random colors, this approach adjusts the brightness and shading of different facial regions based on the background's light source, resulting in a more realistic integration of the face with the background.
The generated face images include the coordinates and mask information from the original 'aligned' images, making them ready for direct use in training models or other applications.
Key Features:
-
Realistic Background Replacement and Lighting Adjustment
- Replaces the background of aligned face images.
- Adds lighting effects consistent with the new background.
- Adjusts facial lighting based on the background's light source for natural-looking results.
-
Ready-to-Use Outputs for Training
- Outputs include aligned coordinates and mask information.
- Generated images can be directly utilized for training machine learning models.
-
Resolution Support
- Supports face images up to a resolution of 1024 pixels.
- Images smaller than 512 pixels or larger than 1024 pixels are rescaled to a resolution within the 512 to 1024 pixels range for optimal processing.
-
Based on Stable Diffusion 1.5 Model
- The processing pipeline utilizes the Stable Diffusion 1.5 (sd1.5) model.
- Systems with 8GB VRAM can handle 512-pixel resolution images.
- Higher resolutions are supported but may require additional testing and resources.
-
Lighting Modes
- Two lighting modes available:
- Based on Text Descriptions: Allows for creative lighting effects guided by textual input.
- Based on Background Images: Adjusts lighting to match the background image, providing better identity consistency of the subject.
- Batch processing utilizes the background image-based lighting mode for optimal results.
-
Generation of Variations
- For each face-background pair, two composite images are generated:
- One with the original background.
- One with a horizontally flipped version of the background.
- Provides variations in lighting and composition for more diverse outputs.
Usage Instructions
-
Preparation
- Extract the software package to your desired location.
- Place aligned face images into the
workspace/aligned directory.
- These are the face images you want to process.
- Place background images into the
workspace/backgrounds directory.
- Supported image formats: JPG, PNG, JPEG, WEBP.
- These images will serve as the new backgrounds and influence the lighting effects.
-
Running the Software
- Execute the batch script included in the package.
- This script will initiate the processing pipeline.
- It will also automatically create a
workspace/outputs directory where all output images will be saved.
- Processing
- The software pairs each face image with each background image.
- Generates composite images with adjusted lighting.
- For each pair, two versions are produced (original and flipped background).
-
GPU Configuration (For Multi-GPU Systems)
- If you have multiple GPUs, you can specify which GPU to use:
- Edit the batch script.
- Locate the parameter
--device cuda:0.
- Change
cuda:0 to the desired CUDA device (e.g., cuda:1 for the second GPU).
Additional Notes
-
Quality Considerations
- Generated images may contain some noise.
- For best results, use background images with simple lighting conditions.
- Post-processing can further enhance image quality.
-
Performance Disclaimer
- No guarantees are made regarding the software's performance or suitability for any purpose.
- The software was packaged for convenience after initial positive testing.
- Users are encouraged to experiment and adjust settings according to their specific needs.
-
Support Policy
- No after-sales support is provided.
- Private messages will not be responded to.
- The developer does not frequently check forums.
- Debugging assistance is offered without guarantee and may be provided sporadically.
Conclusion
This tool offers a convenient way to generate realistic composite images of faces with new backgrounds, complete with adjusted lighting effects that enhance the natural appearance of the subject within the scene. By following the usage instructions, users can process images in batches and customize GPU settings according to their hardware capabilities.
Enjoy exploring the capabilities of this software, and feel free to experiment with different backgrounds and settings to achieve the best results for your projects.