Shilin-LU / TF-ICON

[ICCV 2023] "TF-ICON: Diffusion-Based Training-Free Cross-Domain Image Composition" (Official Implementation)
https://shilin-lu.github.io/tf-icon.github.io/
MIT License
798 stars 103 forks source link

Is it possible to composite multiple images onto one background image? #8

Closed skatld123 closed 1 year ago

skatld123 commented 1 year ago

First of all, thank you for providing such a great code. I would like to use this model to composite various chicken images onto one background image. For example, using chicken images available on GitHub, I would like to composite chicken images with slight variations onto multiple plates in a background image. In that case, I think I will need chicken masks, original chicken images, a background image, and a mask image for the background. I would greatly appreciate it if you could provide an answer!

Shilin-LU commented 1 year ago

Hi, thank you for your kind words and for reaching out with your question!

Certainly, you can integrate multiple chicken images into a single background as per your description. The simplest way is to compose them one by one.

For instance, first compose one chicken image onto the specified area of the background using masks (you may obtain the segmentation mask for chicken through a segmentation model and the background mask drawing by yourself or through notebook_tf_icon.ipynb to directly specify the location and scale of your composition).

Then, use the resultant image as the new background to compose the next chicken image, and so forth.

I hope this helps!