| sd_highres_fix | R Documentation |
Two-pass generation: first creates a base image at native model resolution, then upscales and refines with tiled img2img to produce a high-resolution result with coherent global composition.
sd_highres_fix(
ctx,
prompt,
negative_prompt = "",
width = 2048L,
height = 2048L,
sample_method = SAMPLE_METHOD$EULER,
sample_steps = 20L,
cfg_scale = 7,
seed = 42L,
scheduler = SCHEDULER$DISCRETE,
clip_skip = -1L,
eta = 0,
hr_strength = 0.4,
hr_steps = NULL,
sample_tile_size = NULL,
sample_tile_overlap = 0.25,
upscaler = NULL,
upscale_factor = 4L,
vae_mode = "auto",
vae_auto_threshold = 1048576L,
vae_tile_size = 64L,
vae_tile_overlap = 0.25,
cache_mode = c("off", "easy", "ucache"),
cache_config = NULL
)
ctx |
SD context created by |
prompt |
Text prompt describing desired image |
negative_prompt |
Negative prompt (default "") |
width |
Target output width in pixels (default 2048) |
height |
Target output height in pixels (default 2048) |
sample_method |
Sampling method (see |
sample_steps |
Number of sampling steps (default 20) |
cfg_scale |
Classifier-free guidance scale (default 7.0) |
seed |
Random seed (-1 for random) |
scheduler |
Scheduler type (see |
clip_skip |
Number of CLIP layers to skip (-1 = auto) |
eta |
Eta parameter for DDIM-like samplers |
hr_strength |
Denoising strength for the refinement pass (0.0-1.0, default 0.4). Lower = more faithful to base, higher = more detail/change. |
hr_steps |
Sample steps for refinement pass (default same as sample_steps) |
sample_tile_size |
Tile size in latent pixels for refinement (default auto) |
sample_tile_overlap |
Tile overlap fraction (default 0.25) |
upscaler |
Path to ESRGAN model for upscaling. If NULL, uses bilinear. |
upscale_factor |
ESRGAN upscale factor (default 4, only used with upscaler) |
vae_mode |
VAE processing mode: |
vae_auto_threshold |
Pixel area fallback threshold for
|
vae_tile_size |
Tile size in latent pixels for tiled VAE (default 64).
Ignored when |
vae_tile_overlap |
Overlap ratio between tiles, 0.0-0.5 (default 0.25) |
cache_mode |
Step caching mode: |
cache_config |
Optional fine-tuned cache config from
|
SD image (single image, not list)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.