Get the base resolution for hires.fix right
Hires.fix gives Stable Diffusion images their crisp, high-resolution look — but only if the base resolution of the first pass lands in the model’s trained sweet spot. Set it too high and you get duplicated heads and warped bodies; too low and the upscale looks soft. This calculator takes the final size you want and an upscale factor and tells you exactly what base resolution to generate at, plus a VRAM sanity check.
How the hires.fix math works
Hires.fix is a two-pass pipeline:
- Base pass — generate at a resolution close to the model’s native size (≈512px for SD 1.5, ≈1024px for SDXL).
- Upscale + refine — multiply by the upscale factor and run a short img2img pass to paint in detail.
So the relationship is simply:
base_width = target_width / upscale_factor
base_height = target_height / upscale_factor
The trick is choosing an upscale factor that lands the base size near the model’s native resolution. If you want 2048×2048 from SDXL, a 2× factor gives a 1024×1024 base — perfect. The same target on SD 1.5 would want a ~3× factor to keep the base near 680px.
Tips to avoid out-of-memory and artifacts
- Stay near native. Keep the base long edge within roughly ±50% of the model’s native resolution.
- Watch VRAM on the second pass. The upscaled pass operates at full target resolution — that is where most cards run out of memory. Enable tiled VAE if the estimate is tight.
- Use a low hires denoising. 0.3–0.5 adds detail without changing the composition the base pass established.
- Multiples of 8. Both base and target dimensions should be divisible by 8; the calculator rounds for you.
Common resolution targets and recommended settings
Here are a few popular output sizes with the recommended upscale factors for each model:
SD 1.5 (native ~512px)
| Target resolution | Upscale factor | Base size |
|---|---|---|
| 768 × 768 | 1.5× | 512 × 512 |
| 1024 × 1024 | 2× | 512 × 512 |
| 1536 × 1024 | 2× | 768 × 512 |
| 1920 × 1080 | 2× | 960 × 540 (slightly above native) |
For SD 1.5 targets much above 1280px, a 2.5× or 3× upscale factor is often safer to keep the base near 512px.
SDXL (native ~1024px)
| Target resolution | Upscale factor | Base size |
|---|---|---|
| 1280 × 1280 | 1.25× | 1024 × 1024 |
| 1536 × 1536 | 1.5× | 1024 × 1024 |
| 2048 × 2048 | 2× | 1024 × 1024 |
| 2560 × 1440 | 2× | 1280 × 720 (within SDXL range) |
Understanding the denoising strength setting
The hires denoising strength (also called hires steps’ denoising in Automatic1111) is separate from the main generation’s denoising and controls how much the upscaling pass is allowed to change the image:
- 0.3 or lower — very light touch; adds texture and sharpens detail without moving lines or changing composition. Safe choice for portraits.
- 0.4–0.5 — moderate refinement; the upscaled pass redraws some areas for better detail but the overall composition is stable.
- 0.6–0.7 — stronger refinement; can fix some artifacts from the base pass but risks introducing new composition shifts or inconsistencies.
- 0.8+ — almost a full redraw; often causes the final image to diverge significantly from the base pass. Usually not the intent of hires.fix.
For most outputs, a denoising strength of 0.4–0.5 gives the best balance of sharpness and stability.