| sd_sample_stepwise | R Documentation |
Equivalent to sd_sample for the Euler / Euler-a samplers, but
runs the loop in R so a callback can observe or interrupt each step (e.g.
live preview). For Euler (no ancestral noise) the result is bit-for-bit equal
to sd_sample; Euler-a differs (R RNG vs ggml RNG for the ancestral
term). Other samplers are not supported here — use sd_sample.
sd_sample_stepwise(
ctx,
cond,
uncond = list(crossattn = NULL, vector = NULL, concat = NULL),
latent_shape = NULL,
init_latent = NULL,
noise = NULL,
width = 512L,
height = 512L,
sample_method = SAMPLE_METHOD$EULER,
scheduler = SCHEDULER$DISCRETE,
sample_steps = 20L,
cfg_scale = 7,
seed = 42L,
custom_sigmas = NULL,
on_step = NULL
)
ctx |
SD context |
cond |
Positive conditioning from |
uncond |
Negative conditioning; empty (all |
latent_shape |
Integer |
init_latent |
Optional starting latent (img2img); |
noise |
Optional explicit noise sd_tensor; generated from |
width, height |
Generation size in PIXELS (for the sigma schedule) |
sample_method |
|
scheduler |
Scheduler (name or |
sample_steps |
Number of steps |
cfg_scale |
CFG scale |
seed |
Seed for noise generation when |
custom_sigmas |
Optional explicit sigma schedule (overrides scheduler) |
on_step |
Optional callback |
An sd_tensor — the denoised latent x_0.
sd_sample, sd_decode_latent
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.