Place AI Image Subjects More Precisely With GLIGEN
Neutral Image generation By What The Future Newsroom · March 11, 2023 · 2 min read

Place AI Image Subjects More Precisely With GLIGEN

GLIGEN adds bounding boxes and keypoints to text prompts, giving users more control over where objects and people appear in generated images. Its grounding features are trained in added layers while the underlying image model’s weights stay frozen.

Text prompts can describe what an AI-generated image should contain, but specifying exactly where each subject belongs is less reliable. GLIGEN offers another way to guide composition: users can provide visual placement information alongside words.

“GLIGEN offers more precise control over image composition, a routine capability improvement with little clear risk of harm or human skill erosion.”Why it scores Neutral

Adding position to the prompt

GLIGEN stands for Grounded-Language-to-Image Generation. Researchers at the University of Wisconsin-Madison, Columbia University and Microsoft presented the method as a way to give image models grounding inputs, such as bounding boxes that indicate an object’s position and size.

That extra input addresses a limitation of text-only control. A prompt might name several objects and describe their arrangement, but the model may implement those compositional details only moderately well. Boxes make the intended layout more explicit.

The boxes can overlap, allowing a user to specify subjects whose areas intersect. GLIGEN also supports adding detail to boxes through Img2Img, or bringing them into existing images with inpainting.

Guiding people with keypoints

For images of people, GLIGEN can use keypoints to represent posture. These points provide guidance about a person’s pose as the model synthesizes the image.

Boxes and keypoints serve a similar purpose: they turn parts of a visual instruction into spatial information rather than leaving all placement decisions to a written description. Text still contributes to the request, while the grounding input helps define where or how a subject should appear.

New capabilities in added layers

GLIGEN is designed to add grounding capabilities without changing the weights of the underlying pretrained image model. During training, those weights are frozen, while new layers learn from box-text image pairs.

The researchers describe the added layers as a more cost-efficient alternative to full-model finetuning. Their approach continually pretrains the new layers on grounding data made up of images, text and boxes, while retaining the capabilities of the original model.

The modular design is compared to Lego: different trained layers can be plugged in to provide different capabilities. In this case, the added layers bring spatial grounding to an image model while leaving its existing weights untouched.

How GLIGEN fits among image controls

GLIGEN is similar to ControlNet, another way of adding control to a pretrained diffusion model. The article describes ControlNet as offering additional control capabilities, while GLIGEN’s notable contribution is grounding through boxes and keypoints.

The method was available to try for free in a browser on Hugging Face. At the time described in the source article, it had not yet been integrated into an application for an image model such as Stable Diffusion.

GLIGEN shows how image generation can take direction from more than a sentence. By combining text with spatial cues, it gives users a clearer way to specify composition and pose, while its added-layer training approach is intended to preserve the underlying model’s existing capabilities.

Artificial intelligenceImage generationGLIGENMachine learning
← Back to the wire

Read next