mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
fix(diffusers): correctly parse height and width request without parametrization (#4082)
* fix(diffusers): allow to specify width and height without enable-parameters Let's simplify usage by not gating width and height by parameters Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * chore: use sane defaults Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
b59e16742e
commit
b425a870b0
2 changed files with 14 additions and 4 deletions
|
@ -136,6 +136,11 @@ func ImageEndpoint(cl *config.BackendConfigLoader, ml *model.ModelLoader, appCon
|
|||
config.Backend = model.StableDiffusionBackend
|
||||
}
|
||||
|
||||
if !strings.Contains(input.Size, "x") {
|
||||
input.Size = "512x512"
|
||||
log.Warn().Msgf("Invalid size, using default 512x512")
|
||||
}
|
||||
|
||||
sizeParts := strings.Split(input.Size, "x")
|
||||
if len(sizeParts) != 2 {
|
||||
return fmt.Errorf("invalid value for 'size'")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue