| sd_txt2img_tiled | R Documentation |
Generates images at any resolution using tiled sampling: at each denoising step the latent is split into overlapping tiles, each tile is denoised independently by the UNet, and results are merged with Gaussian weighting. VRAM usage is bounded by tile size, not output resolution.
sd_txt2img_tiled(
ctx,
prompt,
negative_prompt = "",
width = 2048L,
height = 2048L,
sample_tile_size = NULL,
sample_tile_overlap = 0.25,
sample_method = SAMPLE_METHOD$EULER,
sample_steps = 20L,
cfg_scale = 7,
seed = 42L,
batch_count = 1L,
scheduler = SCHEDULER$DISCRETE,
clip_skip = -1L,
eta = 0,
vae_mode = "auto",
vae_auto_threshold = 1048576L,
vae_tile_size = 64L,
vae_tile_overlap = 0.25,
vae_tile_rel_x = NULL,
vae_tile_rel_y = NULL,
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 image width in pixels (can exceed model native resolution) |
height |
Target image height in pixels |
sample_tile_size |
Tile size in latent pixels (default |
sample_tile_overlap |
Overlap between tiles as fraction of tile size, 0.0-0.5 (default 0.25). |
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) |
batch_count |
Number of images to generate (default 1) |
scheduler |
Scheduler type (see |
clip_skip |
Number of CLIP layers to skip (-1 = auto) |
eta |
Eta parameter for DDIM-like samplers |
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) |
vae_tile_rel_x |
Relative tile width as fraction of latent width (0-1)
or number of tiles (>1). NULL = use |
vae_tile_rel_y |
Relative tile height as fraction of latent height (0-1)
or number of tiles (>1). NULL = use |
cache_mode |
Step caching mode: |
cache_config |
Optional fine-tuned cache config from
|
Requires tiled VAE (enabled automatically via vae_mode = "auto").
List of SD images
## Not run:
ctx <- sd_ctx("sd15.safetensors", model_type = "sd1")
imgs <- sd_txt2img_tiled(ctx, "a vast mountain landscape",
width = 2048, height = 1024)
sd_save_image(imgs[[1]], "landscape.png")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.