Appearance
Model Architecture
SoraSR uses a three-stage restoration topology: Shallow Feature Extraction, Deep Hybrid Residual-Attention Body, and Sub-Pixel Reconstruction. This separation preserves low-frequency color fidelity via a long skip connection while focusing network capacity on high-frequency edge and texture synthesis.
High-Level Data Flow
text
LR Input (B, 3, H, W)
│
├─► Shallow Conv 3×3 ──────────────────────────┐ (Long Residual Skip)
│ │ │
│ ▼ │
│ [ Stage 1..N: Hybrid Residual Group ] │
│ ├─ Local Multi-Scale Depthwise Block │
│ ├─ Shifted-Window Multi-Head Attention │
│ └─ Gated Feed-Forward Network (GFFN) │
│ │ │
│ ▼ │
│ Body Conv 3×3 ─────────── (+) ◄────────────┘
│ │
│ ▼
│ PixelShuffle Upsampler (×2 / ×4)
│ │
│ ▼
└─────────────────────► SR Output (B, 3, sH, sW)Shallow Feature Extraction
Given a low-resolution input tensor
Using an unnormalized linear projection at the entry prevents early clipping of subtle luminance gradients and stabilizes residual addition across deep stages.
Hybrid Residual-Attention Group (HRAG)
Pure convolutional backbones have limited receptive fields on repetitive architectural textures, whereas pure Vision Transformers incur quadratic attention overhead and struggle with sharp local sub-pixel alignment. Each HRAG block couples both mechanisms in parallel:
1. Local Multi-Scale Depthwise Branch
Splits channels into three groups processed by
2. Windowed Self-Attention Branch
Partitions features into non-overlapping
where
3. Gated Feed-Forward Network (GFFN)
Replaces the standard two-layer MLP with a depthwise-enhanced gating unit:
Elementwise gating suppresses noise amplification on smooth backgrounds such as sky or studio gradients.
Sub-Pixel Reconstruction Head
Rather than transposed convolutions (which introduce checkerboard artifacts), SoraSR uses progressive PixelShuffle upsampling. For Conv3x3 -> PixelShuffle(2) -> LeakyReLU) expand spatial resolution cleanly before a final
Architectural Constraints for Export
To guarantee clean ONNX and TensorRT conversion:
- Input dimensions are padded internally to multiples of window size
and cropped back after upsampling. - Relative position indices are precomputed as constant buffers for static exports or computed via pure tensor ops for dynamic shapes.
- All normalization layers use
LayerNormwith explicit epsilon (1e-5) and avoid custom fused CUDA ops during export mode.