Synergizing Geometry, Lighting, and Style for High-Fidelity Texture Generation
🔧 Installation • 🚀 Quick Start • 🎯 Overview • 🔬 Method • 📖 Citation
The core mission of our work is to introduce SynergyFrame, a unified framework capable of generating high-fidelity, physically realistic textures. This framework is designed to synergize multiple control signals—specifically geometry, lighting, and style—to achieve seamless and detailed local stylization, thereby empowering and enhancing mainstream generative workflows.
Existing workflows, while powerful, face significant challenges when guided by multiple, often conflicting, control signals:
InpaintingWorkflows: The strong structural and boundary constraints inherent to inpainting often suppress the effective expression of style signals. This leads to results where the stylization is either muted, coarse, or fails to integrate naturally.Image-to-ImageWorkflows: The creative freedom of these models is a double-edged sword. In unconstrained regions, they are prone to producing checkerboard artifacts or style leakage, which contaminates the original, unmasked content.
To address these challenges, we propose SynergyFrame, a universal solution built upon two foundational pillars that transform signal conflict into synergy.
Click to see the SynergyFrame Architecture Diagram
graph TD
subgraph "Inputs"
A[Geometry]
B[Lighting]
C[Style]
D[Mask]
end
subgraph "SynergyFrame Core"
P1["Pillar 1: Physics-Prior Injection<br/>(MultiScaleDepth, DirectionalShading)"]
P2["Pillar 2: Adaptive Semantic Fusion<br/>(Semantic Sparse Attention - SSA)"]
A & B --> P1
C & D --> P2
P1 --> SR
P2 --> SR
SR{Synergized Representation}
end
subgraph "Empowered Workflows"
W1[Inpainting]
W2[Image-to-Image]
SR --> W1 & W2
end
subgraph "Outputs"
O1["✔️ High-Fidelity Results<br/>✔️ No Style Suppression"]
O2["✔️ Artifact-Free<br/>✔️ No Style Leakage"]
W1 --> O1
W2 --> O2
end
The SynergyFrame architecture, turning conflicting signals into a synergistic force for photorealistic stylization.
To ground our stylization in physical reality, we inject crucial environmental priors at the outset.
- Multi-Scale Geometric Awareness: The
MultiScaleDepthEnhancementmodule provides the model with a comprehensive understanding of the scene's geometric structure across various scales. - Lighting-Aware Initialization: The
DirectionalShadingModuleestablishes a coherent lighting environment, ensuring that the generated style interacts harmoniously with shadows and highlights.
This pillar enables our framework to intelligently adapt to different workflows and resolve their core weaknesses.
- Core Mechanism: Semantic Sparse Attention (SSA): We introduce a plug-and-play Semantic Sparse Attention mechanism. SSA compels the model to perform precise semantic matching at the attention level, ensuring the style is applied only where it makes semantic sense.
- Adaptive Capabilities:
- For
Inpainting: SSA's strong semantic matching breaks through inherent style suppression, enabling fine-grained and accurate style injection even under strong structural constraints. - For
Image-to-Image: When combined with a mask, SSA precisely constrains the style's application area, effectively preventing artifacts and content leakage.
- For
# 1. Clone the repository
git clone https://github.com/jackeyloveseven/SynergyFrame.git
cd SynergyFrame
# 2. Install dependencies (example)
# Create a requirements.txt file with your dependencies
# pip install -r requirements.txt
# Example dependencies:
pip install diffusers transformers torch torchvision
pip install accelerate opencv-python pillow numpy matplotlib
pip install rembg html4vision
# 3. Download models
mkdir -p checkpoints sdxl_models models
# Place required models in their respective directories:
# - checkpoints/depth_anything_v2_vitb.pth
# - models/ip-adapter_sdxl_vit-h.bin
# - models/image_encoder/Note: Please refer to the original model repositories for official download links.
SynergyFrame enhances two primary workflows.
This workflow leverages strong geometric and boundary constraints, now enhanced with powerful style injection via SSA.
python SynergyFrame.py --backbone='Inpaint'
This workflow offers greater creative freedom, with SSA preventing style leakage and artifacts.
python SynergyFrame.py --backbone='Img2Img'Our narrative focuses on synergy, not opposition. SynergyFrame is not about proving one workflow's superiority but about acting as a higher-level, unified control framework. It elevates both Inpainting and Image-to-Image to new heights in local stylization tasks.
| Method | Boundary Preservation | Style Fidelity | Artifact Suppression |
|---|---|---|---|
| Baseline (IP-Adapter Only) | ❌ | ⭐⭐⭐ | ❌ |
| + Physics Priors | ✅ | ⭐⭐⭐⭐ | ❌ |
| SynergyFrame (Priors + SSA) | ✅ | ⭐⭐⭐⭐⭐ | ✅ |
If you find SynergyFrame useful for your research, please consider citing our work:
@misc{synergyframe2025,
title={SynergyFrame: A Unified Framework for Photorealistic Local Stylization},
author={The SynergyFrame Team},
year={2025},
publisher={GitHub},
journal={GitHub repository},
howpublished={\url{https://github.com/jackeyloveseven/SynergyFrame}}
}Our work builds upon the incredible contributions of the open-source community. We extend our sincere gratitude to the developers and researchers behind:
- Stable Diffusion XL
- IP-Adapter
- DepthAnything V2
- ControlNet
- 🤗 Diffusers
🌟 Star this repository if SynergyFrame inspires your work! 🌟



