OmniGen can generate new images based on specific objects or identities from input images without requiring external detection/cropping models.
Key Features:
- Multi-object identification: Use descriptive instructions in the prompt to identify specific objects in multiple input images using the placeholder format
<img><|image_N|></img> (e.g., the man in <img><|image_1|></img>). - Object extraction: Extract multiple objects from different images to combine them into a single new scene.
Usage: Pass a list of image paths to input_images and use the <img><|image_N|></img> syntax in your prompt to reference them.
prompt = "Two woman are raising fried chicken legs in a bar. A woman is <img><|image_1|></img>. Another woman is <img><|image_2|></img>."
input_images = ["./imgs/test_cases/mckenna.jpg", "./imgs/test_cases/Amanda.jpg"]
images = pipe(
prompt=prompt,
input_images=input_images,
height=1024,
width=1024,
guidance_scale=2.5,
img_guidance_scale=1.8,
max_input_image_size=1024,
seed=168
)
images[0].show()