mudler/LocalAI · warning
Invalid scheduler, using default: %s\n
Error message
Invalid scheduler, using default: %s\n
What it means
Warning during generation setup: the scheduler string failed to parse via str_to_scheduler(), so sd_get_default_scheduler(sd_ctx, sample_method) selects the default scheduler paired with the chosen sampler. Generation proceeds; the noise schedule differs from the requested one, which can shift output quality.
Source
Thrown at backend/go/stablediffusion-ggml/cpp/gosd.cpp:701
sample_method_t sm = str_to_sample_method(sampler);
if (sm != SAMPLE_METHOD_COUNT) {
sample_method_found = (int)sm;
fprintf(stderr, "Found sampler: %s\n", sampler);
}
if (sample_method_found == -1) {
sample_method_found = sd_get_default_sample_method(sd_ctx);
fprintf(stderr, "Invalid sample method, using default: %s\n", sd_sample_method_name((sample_method_t)sample_method_found));
}
sample_method = (sample_method_t)sample_method_found;
scheduler_t sched = str_to_scheduler(scheduler_str);
if (sched != SCHEDULER_COUNT) {
scheduler = sched;
fprintf(stderr, "Found scheduler: %s\n", scheduler_str);
}
if (scheduler == SCHEDULER_COUNT) {
scheduler = sd_get_default_scheduler(sd_ctx, sample_method);
fprintf(stderr, "Invalid scheduler, using default: %s\n", sd_scheduler_name(scheduler));
}
sd_c = sd_ctx;
return 0;
}
void sd_tiling_params_set_enabled(sd_tiling_params_t *params, bool enabled) {
params->enabled = enabled;
}
void sd_tiling_params_set_tile_sizes(sd_tiling_params_t *params, int tile_size_x, int tile_size_y) {
params->tile_size_x = tile_size_x;
params->tile_size_y = tile_size_y;
}
void sd_tiling_params_set_rel_sizes(sd_tiling_params_t *params, float rel_size_x, float rel_size_y) {
params->rel_size_x = rel_size_x;View on GitHub (pinned to 44413a9d06)
Solutions
- Correct the scheduler name to an exact enum string (e.g. discrete, karras, exponential, ays)
- Or omit it and accept the default pairing for the sampler
- Verify via the 'Found scheduler:' log line
Example fix
// before scheduler = "Karras"; // not matched // after scheduler = "karras";
Defensive patterns
Strategy: validation
Validate before calling
// Go caller: whitelist schedulers
validSchedulers := map[string]bool{"discrete": true, "karras": true, "exponential": true, "ays": true, "gits": true}
if req.Scheduler != "" && !validSchedulers[req.Scheduler] {
return fmt.Errorf("unknown scheduler %q", req.Scheduler)
} Prevention
- Validate sampler and scheduler together at the request boundary
- Lowercase/trim incoming strings before matching enum names
When it happens
Trigger: Passing scheduler with an unrecognized name (typo, wrong case, e.g. 'karras ' with trailing space or 'KARRAS' if the parser is case-sensitive); using a scheduler added after the vendored sd.cpp version.
Common situations: Sampler/scheduler pairs copied from other UIs; configs shared across LocalAI versions with different bundled sd libraries.
Related errors
- Invalid sample method, using default: %s\n
- Invalid scheduler '{'k_' if is_karras else ''}{name}'
- Invalid LoRA multiplier '%s', skipping\n
- Invalid rng_type: %s, using default\n
- Invalid sampler_rng_type: %s, using default\n
AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15).
Data as JSON: /api/errors/a598d233f1558062.
Report an issue: GitHub.