General Introduction
PiT (Piece it Together) is an open source tool hosted on GitHub and developed by researchers such as Elad Richardson of Tel Aviv University. It allows users to input bits and pieces of an image, such as wings, hairstyles, or eyes, and then use artificial intelligence techniques to generate a complete image.PiT eliminates the need for textual descriptions, using the parts of the image as input, and relies on a pre-trained model, IP-Prior, to fill in the missing pieces, and then finally renders the result via SDXL. This tool is suitable for visual designers or researchers to quickly piece together creative ideas. The latest code and instructions for PiT as of March 25, 2025 can be viewed on GitHub.
Function List
- jigsaw puzzle: Input fragmented image parts to generate a complete image.
- Consistent details: Complementary images remain consistent throughout, depending on the characteristics of the part.
- Pure image input: No text prompts are needed, just pictures to operate.
- Multiple results: Supports different numbers of parts, generating a wide range of possible images.
- open source project: The code is publicly available on GitHub and can be freely downloaded and modified.
- Styles available: Supports generation of specific style images by IP-LoRA adjustment.
- domain adaptation: Different IP-Prior models can be used to generate images suitable for specific topics.
Using Help
PiT is an open source project on GitHub for users with basic programming skills. Here is a detailed installation and usage guide to help you get started quickly.
Installation process
- Preparing the environment
- Make sure your computer has Python 3.8 or higher.
- Installing Git (Windows from
git-scm.com
Download, Mac/Linux Inputgit --version
(Check). - It is recommended to use a device with a GPU (e.g. NVIDIA graphics card with CUDA) to speed up the generation. It can be used without GPU, but it is slower.
- Download Code
- Open a terminal or command line.
- Enter the command to download PiT:
git clone https://github.com/eladrich/PiT.git
- Go to the project folder:
cd PiT
- Installation of dependencies
- The project requires Python libraries such as
torch
,numpy
The list is in therequirements.txt
Center. - Run the command to install:
pip install -r requirements.txt
- If you do not have this file, refer to the README Installation
diffusers
,transformers
etc.
- The project requires Python libraries such as
- Getting the model
- PiT relies on the IP-Prior and IP-Adapter+ models, download links are on GitHub or in the paper (https://arxiv.org/abs/2503.10365).
- Place the model in the specified directory (e.g.
models/
), the path looks at the README.
- Installation of SDXL
- PiT renders images with SDXL. Installation
diffusers
::pip install diffusers
- Download the SDXL model from Hugging Face and save it locally.
- PiT renders images with SDXL. Installation
Usage
- Prepare parts
- Collect image parts (e.g. ears, logos) in PNG format with clean backgrounds is recommended.
- Into the input folder in the project (e.g.
input/
).
- running program
- Enter the PiT catalog in your terminal.
- Execute the script (assuming
generate.py
(see README for details):python generate.py --input_dir input/ --output_dir output/
- Parameter Description:
--input_dir
: Parts folder.--output_dir
: The results are saved in the folder.
- The program generates the full image with the part.
- View Image
- After generating, open the
output/
Folder View. - If you are not satisfied, add more parts or change the clear image.
- After generating, open the
Featured Function Operation
- part number
You can enter 1 or more parts. For example, give "paw" and "tail" to generate a complete animal. It is better to have the same style of parts. - styling
Style cues can be added with IP-LoRA. Example:python generate.py --input_dir input/ --output_dir output/ --prompt "卡通风格"
Cartoonized images can then be generated.
- (math.) commutative domain model
PiT supports different IP-Prior models (e.g. toys, creatures). The corresponding model file is loaded when switching, see README for operation. - Optimization results
If the image is blurred, check if the part is clear, or add parameters:python generate.py --input_dir input/ --steps 50
caveat
- Parts should be clear and avoid being too small or cluttered.
- First run is slow, subsequent runs will be fast.
- Install the missing libraries as prompted in the event of an error.
These steps will help you put together a complete image with PiT. The operation requires programming, but the process is simple.
application scenario
- Design Inspiration
Designers enter parts (e.g., wings, hats) to put together complete characters and quickly try out ideas. - Product Concept
Developers use parts (e.g., buttons, shapes) to generate new product images and explore design directions. - Technical Learning
Researchers used PiT to test how AI can puzzle from parts to understand the principles of image generation.
QA
- What is the difference between PiT and other tools?
PiT uses image parts for direct puzzles without text, suitable for visual creation. - Do you have to train the model?
Not necessary, there are official pre-trained models, but you can train and adjust them yourself. - Is it fast to generate?
Not fast, takes a few seconds to a few minutes, depending on the device.