Photo Merge
Seamlessly integrate a photo's subject into AI-generated output and eliminate the need to create time-consuming custom facial finetunes.
OctoAI Photo Merge feature allows you to seamlessly integrate a photo’s subject into high-quality AI-generated output. It eliminates the need to create time-consuming custom facial fine-tunes with numerous tuning images and 15-30 minutes typically associated with SDXL LoRAs. OctoAI’s Photo Merge simplifies this process, requiring only 1-4 images and delivering precise results within a few seconds. Businesses can now easily apply GenAI powered imagery for needs ranging from realistic CGI characters, to personalized product recommendations, to digital avatars.
Photo Merge can be accessed through the “transfer_images” parameter within OctoAI’s Image Generation API. This parameter accepts a key-value pair consisting of a trigger word and an array of up to 4 images. It operates exclusively with SDXL models and seamlessly harmonizes with style presets, controlnets, checkpoints, and LoRAs when utilized with SDXL models, thereby amplifying its adaptability and functionality.
In the example below, we will upload 1-4 images of a human and use photo merge to transfer his face into our prompts.
Example Code Snippet showing the close portriat images of a human:
Next, we utilize the transfer_images="triggerword": list of images parameter
within the payload of OctoAI’s SDXL Image Gen API at https://image.octoai.run/generate/sdxl
.
Example Code Snippet of using Photo Merge (transfer_images):
In the given example, we employ the trigger word ‘luis’ and link it with the dataset comprising the four images mentioned earlier. Subsequently, we structure the prompt to incorporate the trigger word.
Prompt: A man luis sitting in a coffee shop.
It’s worth noting that in this instance, no LoRA is utilized. Additionally, we utilize a checkpoint named ‘RealVisXL’, an OctoAI asset checkpoint specifically optimized for the Photo Merge feature. However, it’s important to mention that the Photo Merge feature is functional even if the base SDXL checkpoint is utilized.
Below are the AI-generated output images after using transfer_image parameter with the newly provided prompt:
Pretty accurate, isn’t it? Let’s try it with few different prompts and combine it with other style presets, LoRAs and checkpoints to confirm whether we consistently get the accurate results.
Let us use transfer_images parameter in conjunction with ‘Graffiti’ style preset. We are keeping all other parameter values similar to the payload above.
Example Code Snippet of Photo Merge (transfer_images parameter) with Style Preset:
Let’s now use transfer_images parameter with a pre-trained Style LoRA. We have already imported a pre-trained style based LoRA into OctoAI’s Asset Library. In the payload below, we are using the corresponding asset’s asset id and assigning it a weight of 1.0.
Example Code Snippet of Photo Merge (transfer_images parameter) with pre-trained LoRAs (uploaded from external sources):
Next, we’ll create a custom fine-tune for a product and seamlessly integrate our AI-generated human model’s image with it. To create custom fine tunes (SDXL LoRAs), we will upload 10-12 images of our product, which in our case are different colored Lacoste polo shirts for men.
Example Code Snippet of Photo Merge (transfer_images parameter) with custom fine-tuned LoRAs:
Let’s now consider a use-case where we want to mix the identities of 2 or more humans. For this let’s consider a new set of close up portriats of another human as shown below:
Example Code Snippet of Photo Merge (transfer_images parameter) with multiple human portraits:
Photo Merge offers endless potential - whether in entertainment, gaming, marketing agencies, or fashion and retail sectors, it can help craft personalized avatars, advertisements, and brand ambassador representations. It can also enable virtual try-ons and lifelike digital product showcases.