mudler/LocalAI · warning
Invalid sampler_rng_type: %s, using default\n
Error message
Invalid sampler_rng_type: %s, using default\n
What it means
Warning from the option parser: 'sampler_rng_type=<value>' is not a valid enum name for str_to_rng_type(), so the sampler RNG falls back to the library default. Identical mechanism to the rng_type warning, but for the RNG used during sampling.
Source
Thrown at backend/go/stablediffusion-ggml/cpp/gosd.cpp:550
if (!strcmp(optname, "flow_shift")) flow_shift = atof(optval);
if (!strcmp(optname, "rng_type")) {
rng_type_t parsed = str_to_rng_type(optval);
if (parsed != RNG_TYPE_COUNT) {
rng_type = parsed;
fprintf(stderr, "Found rng_type: %s\n", optval);
} else {
fprintf(stderr, "Invalid rng_type: %s, using default\n", optval);
}
}
if (!strcmp(optname, "sampler_rng_type")) {
rng_type_t parsed = str_to_rng_type(optval);
if (parsed != RNG_TYPE_COUNT) {
sampler_rng_type = parsed;
fprintf(stderr, "Found sampler_rng_type: %s\n", optval);
} else {
fprintf(stderr, "Invalid sampler_rng_type: %s, using default\n", optval);
}
}
if (!strcmp(optname, "prediction")) {
prediction_t parsed = str_to_prediction(optval);
if (parsed != PREDICTION_COUNT) {
prediction = parsed;
fprintf(stderr, "Found prediction: %s\n", optval);
} else {
fprintf(stderr, "Invalid prediction: %s, using default\n", optval);
}
}
if (!strcmp(optname, "lora_apply_mode")) {
lora_apply_mode_t parsed = str_to_lora_apply_mode(optval);
if (parsed != LORA_APPLY_MODE_COUNT) {
lora_apply_mode = parsed;
fprintf(stderr, "Found lora_apply_mode: %s\n", optval);
} else {
fprintf(stderr, "Invalid lora_apply_mode: %s, using default\n", optval);View on GitHub (pinned to 44413a9d06)
Solutions
- Correct the value to an exact enum name from the vendored str_to_rng_type
- Remove the option to use the default sampler RNG
- Look for the 'Found sampler_rng_type:' confirmation line in the log to verify
Example fix
# before options: "...,sampler_rng_type=philox " # typo/trailing space # after options: "...,sampler_rng_type=philox"
Defensive patterns
Strategy: validation
Validate before calling
// Go caller: same whitelist check for the sampler RNG option
if o, ok := opts.Raw["sampler_rng_type"]; ok && !validRng[o] {
return fmt.Errorf("invalid sampler_rng_type %q", o)
} Prevention
- Share one RNG-name whitelist between rng_type and sampler_rng_type validation
- Watch for the 'Found sampler_rng_type:' confirmation line after config changes
When it happens
Trigger: Setting sampler_rng_type to a string not recognized by the vendored stable-diffusion.cpp build (typo, wrong case, or version-mismatched enum name).
Common situations: Config files shared across LocalAI versions whose bundled sd library supports different RNG names; misspellings in gallery model definitions.
Related errors
- Invalid rng_type: %s, using default\n
- Invalid prediction: %s, using default\n
- Invalid lora_apply_mode: %s, using default\n
- Invalid wtype: %s, using default\n
- Embedding directory does not exist or is not a directory: %s
AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15).
Data as JSON: /api/errors/88fa5364c1fd053c.
Report an issue: GitHub.