NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Prompting Diffusion Models for Zero-Shot Instance Segmentation

Irem Zeynep Alagöz, Nils Morbitzer, Andrea Ramazzina, Nassir Navab, Federico Tombari, Stefano Gasperini

TL;DR

Prompt2Seg introduces a novel framework that brings interactive, click-based control directly into the generative pipeline of diffusion models for instance segmentation. By actively conditioning a frozen diffusion backbone using a lightweight ControlNet branch, it leverages rich generative priors to deliver superior zero-shot generalization, outperforming foundation models like SAM on complex, out-of-domain datasets.

What Problem Does This Paper Address?

While discriminative foundation models like the Segment Anything Model (SAM) have revolutionized interactive segmentation, they are trained primarily on label boundaries. Consequently, they lack deep structural priors about object appearance, which frequently causes them to over-segment objects with sharp internal edges or fail when boundaries are blurry.

Conversely, generative diffusion models possess a strong internal understanding of object "wholeness" due to their self-supervised pretraining on billions of images. However, existing attempts to use these models for interactive segmentation (such as Gen2Seg) treat user prompts as a passive, post-hoc filtering step. Because the underlying feature extraction process remains agnostic to user intent, these methods yield suboptimal segments. Prompt2Seg bridges this gap by actively injecting spatial prompts directly into the diffusion process.

Methods

Prompt2Seg builds upon the frozen image-to-image architecture of Gen2Seg but fundamentally alters how user intent guides the model.

Instead of generating a full-image instance map and filtering it later, Prompt2Seg uses a lightweight ControlNet branch to inject prompt-dependent residuals into the blocks of a frozen diffusion U-Net backbone.

[Input Image] ---> [Frozen VAE] ---> [Frozen Denoising Diffusion U-Net] ---> [Target Mask]
                                                    ^
                                                    | (Residuals)
[User Clicks] ---> [Spatial Prompt Maps] ---> [Trainable ControlNet]

Key technical details include:

  • Spatial Prompt Representation: User point prompts (clicks) are transformed into continuous, image-like spatial maps using a two-scale Gaussian encoding ($\sigma_s = 8$ pixels for precise localization and $\sigma_l = 16$ pixels for neighborhood context).
  • Prompt-Conditioned Architecture: The ControlNet branch processes these multi-scale prompt maps alongside the image latents, forcing the diffusion model to focus exclusively on generating the prompted object.
  • Output Semantics: The model directly predicts a single prompt-conditioned foreground region against a black background in an RGB embedding space, which is then converted to a binary mask via simple distance thresholding.
Figure 2: Our Prompt2Seg framework. Prompt2Seg segments any instance by guiding the diffusion process with a ControlNet conditioned on the user prompts as Gaussian maps.

Datasets

To demonstrate pure zero-shot generalization, the model was fine-tuned only on synthetic data from two datasets:

  • Hypersim: Photorealistic indoor environments.
  • Virtual KITTI 2: Simulated outdoor driving scenes.

It was then evaluated across seven diverse real-world benchmarks completely absent from training:

  • COCO (excluding categories seen during fine-tuning)
  • DRAM (artistic paintings)
  • EgoHOS (egocentric hand-object interactions)
  • PIDRay (luggage X-ray scans)
  • Pascal VOC & HRSOD (natural and high-resolution salient images)
  • ZeroWaste (cluttered industrial waste)
  • RoadAnomaly (used for testing dense uncertainty map refinement)

Key Insights and Ideas

  • Generative Priors Excel at the Long-Tail: Discriminative models like SAM struggle with domain shifts because they are bound to the distribution of their curated training masks. Generative models, having seen a much broader visual distribution during pretraining, maintain an understanding of object structure even in abstract domains like art paintings or X-rays.
  • Active Guidance vs. Passive Filtering: Conditioning the diffusion layers during the denoising process allows the model to resolve ambiguities that post-hoc feature filtering cannot fix.
  • Synthetic-to-Real Generalization: Because the trainable branch only learns to map spatial intent to generative features rather than memorizing specific class labels, the framework generalizes incredibly well from limited synthetic data to complex real-world scenes.

Key Results

Prompt2Seg consistently outperformed its generative predecessor (Gen2Seg) and discriminative baselines across all zero-shot benchmarks.

Most notably, it surpassed the heavily supervised SAM on long-tail and highly challenging domains:

  • DRAM (Art): 53.1 mIoU vs. SAM's 51.6
  • PIDRay (X-ray): 47.5 mIoU vs. SAM's 44.2
  • ZeroWaste (Clutter): 51.4 mIoU vs. SAM's 45.4

On standard natural image datasets (VOC, EgoHOS, HRSOD), Prompt2Seg closed the performance gap to SAM within 3–5 IoU points, despite SAM being trained on over a billion human-annotated masks.

Additionally, when evaluated on the RoadAnomaly dataset using dense uncertainty maps instead of sparse clicks, Prompt2Seg successfully acted as a refinement module, slashing the False Positive Rate (FPR) of the base Mask2Former model from 11.83% to 4.95%.

Figure 3: Qualitative Results from various datasets (left) comparing Prompt2Seg with SAM and Gen2Seg. SAM masks are binary, unlike the others, which output features, shown here masked.

Limitations and Future Work

Despite its strong performance, Prompt2Seg inherits a fundamental limitation from latent diffusion models: struggling with small objects. This is primarily caused by the spatial compression bottleneck within the frozen VAE, which discards fine-grained details of tiny instances.

Furthermore, a single spatial prompt can sometimes result in ambiguity regarding the desired granularity (e.g., segmenting just a cat's head versus the entire cat). The authors suggest that future iterations could benefit from training with negative prompts or developing hierarchical architectures capable of outputting masks at multiple granularities.

Summary updated

BibTeX
@inproceedings{alagoz2026prompting,
  author = {Irem Zeynep Alagöz and Nils Morbitzer and Andrea Ramazzina and Nassir Navab and Federico Tombari and Stefano Gasperini},
  title = {{Prompting Diffusion Models for Zero-Shot Instance Segmentation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=3NQtKkQP2m},
}
Figure