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

Generating Non-Stationary Textures using Self-Rectification

Yang Zhou, Rongjun Xiao, Dani Lischinski, Daniel Cohen-Or, Hui Huang

Introduction

Texture synthesis involves generating large-scale images from small examples. While stationary textures like grass or sand are well-handled by existing algorithms, non-stationary textures—those containing complex structures like wood grain or leaf veins—remain difficult to synthesize with user control. Traditional methods often require extensive optimization or lack spatial controllability.

Examples of the self-rectification process on wood and leaf textures, showing the transition from reference to user edit to final result.

This paper introduces a "self-rectification" method that enables a "lazy-editing" workflow. Users can create a crude collage of texture patches, and the system automatically transforms this messy input into a seamless, high-quality texture that preserves the intended layout and fine details of the reference.

Methodology

The core of the approach is a two-stage pipeline leveraging a pre-trained Stable Diffusion model without additional fine-tuning. The process moves from a user-defined target image through coarse and fine rectification stages to produce the final output.

The high-level self-rectification pipeline, showing the transition from user edit to final result through coarse and fine stages.
  1. Structure-Preserving Inversion: To maintain the user's layout, the method uses a modified DDIM inversion. By injecting Key-Value (KV) features from the target image back into itself in reverse order, the model prevents the distinctive structures from being lost during the noise-addition process.
  2. Fine-Texture Sampling: During denoising, KV features from the original reference texture are injected into the generation of the new target. This "cross-image attention" mechanism effectively samples high-frequency details from the reference and maps them onto the global structure of the user's sketch.
  3. Coarse-to-Fine Strategy: The process is applied iteratively to ensure large-scale structures are established before refining the smallest details.

Key Innovations

The technical breakthrough lies in Reverse-Order KV Injection. Standard inversion often washes out prominent structures; by injecting features from high-noise time steps into low-noise ones, the U-Net's spatial awareness is anchored to the user's edit. Furthermore, treating the attention layers as a "copy-paste" tool allows the model to act as a context-aware texture sampler rather than a purely generative engine.

Results and Discussion

Evaluated on complex non-stationary textures (e.g., mosaics, wood grain), the method demonstrates qualitative superiority over adversarial expansion (TexExp) and optimization-based methods (GCD Loss). Key results include:

  • Layout Fidelity: The output strictly respects the spatial arrangement of the "lazy-edit" target.
  • Efficiency: Synthesis of a 512x512 image takes approximately three minutes on a single GPU, outperforming many optimization-heavy alternatives.
  • Versatility: The technique extends beyond textures to general image editing, such as repositioning objects within a scene while maintaining seamless backgrounds.

Limitations and Future Work

While effective, the method is currently constrained by the latent space of Stable Diffusion (512x512). Future work aims to address higher resolutions and incorporate semantic understanding to ensure biological or structural consistency, such as ensuring leaf veins connect logically to stems.

Summary updated

BibTeX
@inproceedings{zhou2024generating,
  author = {Yang Zhou and Rongjun Xiao and Dani Lischinski and Daniel Cohen-Or and Hui Huang},
  title = {{Generating Non-Stationary Textures using Self-Rectification}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
}
Figure