Skip to content

[Bug] sd-server ignores --upscale-model and <lora> tags in prompts #1203

Open

Description

@randomqhacker

Git commit

sd-master-9565c7f-bin-Linux-Ubuntu-24.04-x86_64-vulkan.zip
released today, 2025-01-17

Operating System & Version

Ubuntu 25.10

GGML backends

Vulkan

Command-line arguments used

./sd-server --listen-ip 0.0.0.0 --listen-port 8081 --color --diffusion-model z_image_turbo-Q4_K.gguf --vae z-vae.safetensors --llm Qwen3-4B-Instruct-2507-UD-Q5_K_XL.gguf --cfg-scale 1.0 --diffusion-fa --lora-model-dir lora --upscale-model RealESRGAN_x4plus_anime_6B.pth --upscale-repeats 1 -H 240 -W 320 --steps 8;

Steps to reproduce

  1. Attempt to use --upscale-model RealESRGAN_x4plus_anime_6B.pth with sd-server
  2. Notice the model is not loaded in the console output
  3. Generate a request and notice the resolution is not upscaled
  4. Use the same argument with sd-cli and notice that the image is upscaled

What you expected to happen

I expected sd-server to upscale all requests by default when the upscale-model is included on the command line.

What actually happened

upscale-model is ignored.

Logs / error messages / stack trace

No response

Additional context / environment details

using z-image-turbo. upscaling does work in sd-cli with this model.

Activity

  1. randomqhacker commented on Jan 23, 2026

    @randomqhacker
    Author

    Just FYI it appears the server does not support applying LoRAs either.

  2. SolicTous commented on Feb 3, 2026

    @SolicTous
    Contributor

    Same. On Cli upscale works, but on server - not. May it need another way like extra-params?

  3. changed the title [-][Bug] sd-server ignores --upscale-model[/-] [+][Bug] sd-server ignores --upscale-model and <lora> tags in prompts[/+] on Feb 3, 2026
  4. SolicTous commented on Feb 26, 2026

    @SolicTous
    Contributor

    It have to be add in parameters
    "lora": [{"path":"lora.safetensors"}]

    But I have got {'error': 'invalid lora path: lora.safetensors'}

    Full path do not fix that not in server --lora-model-dir not in request

  5. SolicTous commented on Feb 26, 2026

    @SolicTous
    Contributor

    Looks like there are fixed
    #1276

    But for a while it's not commited

  6. djismgaming commented on Mar 4, 2026

    @djismgaming

    I still encounter that the sd-server is ignoring the lora in the prompt. Using the latest build from yesterday. sd-cli does work.

    Edit: Seems it happens when proxying through llama-swap. Directly doing a request via curl actually gives logs of applying the lora in the prompt.

    curl request:

    curl http://127.0.0.1:1234/v1/images/generations `
      -H "Content-Type: application/json" `
      -d '{"model":"Z-Image-Turbo-Vulkan:Q4_K_M","prompt":"<lora:pixel_art_style_z_image_turbo:1> black motorcycle, rider with a red helmet and long blonde hair getting out the back, while running in a caribbean road, sunset style. Camera on the back. Superimposed over the image in the lower side, the words `Motorcycle Lifestyle` in a retro font.","n":1,"size":"512x512"}'
    PS C:\Users\Ismael\Downloads> C:\Users\Ismael\apps\stablediffusioncpp-rocm\sd-server.exe `
    >> --diffusion-model F:\ai\models-image\z-image-turbo-Q4_K_M.gguf `
    >> --llm F:\ai\lmstudio-models\unsloth\Qwen3-4B-Instruct-2507\Qwen3-4B-Instruct-2507-UD-Q4_K_XL.gguf `
    >> --vae F:\ai\stability-matrix\Data\Models\VAE\ae.safetensors `
    >> --lora-model-dir F:/ai/stability-matrix/Data/Models/Lora/ `
    >> --diffusion-fa `
    >> --cfg-scale 1.0 `
    >> --steps 8 `
    >> --seed -1
    [INFO ] src\ggml_extend.hpp:78   - ggml_cuda_init: found 1 ROCm devices:
    [INFO ] src\ggml_extend.hpp:78   -   Device 0: AMD Radeon RX 6800, gfx1030 (0x1030), VMM: no, Wave Size: 32
    [INFO ] stable-diffusion.cpp:263  - loading diffusion model from 'F:\ai\models-image\z-image-turbo-Q4_K_M.gguf'
    [INFO ] model.cpp:366  - load F:\ai\models-image\z-image-turbo-Q4_K_M.gguf using gguf format
    [INFO ] stable-diffusion.cpp:310  - loading llm from 'F:\ai\lmstudio-models\unsloth\Qwen3-4B-Instruct-2507\Qwen3-4B-Instruct-2507-UD-Q4_K_XL.gguf'
    [INFO ] model.cpp:366  - load F:\ai\lmstudio-models\unsloth\Qwen3-4B-Instruct-2507\Qwen3-4B-Instruct-2507-UD-Q4_K_XL.gguf using gguf format
    [INFO ] stable-diffusion.cpp:324  - loading vae from 'F:\ai\stability-matrix\Data\Models\VAE\ae.safetensors'
    [INFO ] model.cpp:369  - load F:\ai\stability-matrix\Data\Models\VAE\ae.safetensors using safetensors format
    [INFO ] stable-diffusion.cpp:341  - Version: Z-Image
    [INFO ] stable-diffusion.cpp:369  - Weight type stat:                      f32: 634  |    q4_K: 266  |    q5_K: 66   |    q6_K: 81   |  iq4_xs: 20   |    bf16: 28
    [INFO ] stable-diffusion.cpp:370  - Conditioner weight type stat:          f32: 145  |    q4_K: 154  |    q5_K: 30   |    q6_K: 49   |  iq4_xs: 20
    [INFO ] stable-diffusion.cpp:371  - Diffusion model weight type stat:      f32: 245  |    q4_K: 112  |    q5_K: 36   |    q6_K: 32   |    bf16: 28
    [INFO ] stable-diffusion.cpp:372  - VAE weight type stat:                  f32: 244
    [INFO ] stable-diffusion.cpp:748  - Using flash attention in the diffusion model
      |====================>                             | 453/1095 - 320.37it/s
      |======================================>           | 851/1095 - 335.97it/s
      |==================================================| 1095/1095 - 399.34it/s
    [INFO ] model.cpp:1598 - loading tensors completed, taking 2.74s (process: 0.00s, read: 1.97s, memcpy: 0.00s, convert: 0.04s, copy_to_backend: 0.20s)
    [INFO ] stable-diffusion.cpp:889  - total params memory size = 8548.81MB (VRAM 8548.81MB, RAM 0.00MB): text_encoders 3602.16MB(VRAM), diffusion_model 4786.65MB(VRAM), vae 160.00MB(VRAM), controlnet 0.00MB(VRAM), pmid 0.00MB(VRAM)
    [INFO ] stable-diffusion.cpp:955  - running in FLOW mode
    [INFO ] main.cpp:1207 - listening on: 127.0.0.1:1234
    [INFO ] stable-diffusion.cpp:1116 - apply lora at runtime
    [INFO ] model.cpp:369  - load F:\ai\stability-matrix\Data\Models\Lora\pixel_art_style_z_image_turbo.safetensors using safetensors format
    [INFO ] src\lora.hpp:40   - loading LoRA from 'F:\ai\stability-matrix\Data\Models\Lora\pixel_art_style_z_image_turbo.safetensors'
      |==================================================| 480/480 - 2285.71it/s
    [INFO ] model.cpp:1598 - loading tensors completed, taking 0.21s (process: 0.00s, read: 0.00s, memcpy: 0.00s, convert: 0.00s, copy_to_backend: 0.00s)
    [INFO ] model.cpp:369  - load F:\ai\stability-matrix\Data\Models\Lora\pixel_art_style_z_image_turbo.safetensors using safetensors format
    [INFO ] src\lora.hpp:40   - loading LoRA from 'F:\ai\stability-matrix\Data\Models\Lora\pixel_art_style_z_image_turbo.safetensors'
      |==================================================| 480/480 - 2307.69it/s
    [INFO ] model.cpp:1598 - loading tensors completed, taking 0.21s (process: 0.00s, read: 0.00s, memcpy: 0.00s, convert: 0.00s, copy_to_backend: 0.00s)
      |==================================================| 480/480 - 2264.15it/s
    [INFO ] model.cpp:1598 - loading tensors completed, taking 0.21s (process: 0.00s, read: 0.05s, memcpy: 0.00s, convert: 0.00s, copy_to_backend: 0.03s)
    [INFO ] model.cpp:369  - load F:\ai\stability-matrix\Data\Models\Lora\pixel_art_style_z_image_turbo.safetensors using safetensors format
    [INFO ] src\lora.hpp:40   - loading LoRA from 'F:\ai\stability-matrix\Data\Models\Lora\pixel_art_style_z_image_turbo.safetensors'
      |==================================================| 480/480 - 2318.84it/s
    [INFO ] model.cpp:1598 - loading tensors completed, taking 0.21s (process: 0.00s, read: 0.00s, memcpy: 0.00s, convert: 0.00s, copy_to_backend: 0.00s)
    [INFO ] stable-diffusion.cpp:1260 - apply_loras completed, taking 0.89s
    [INFO ] stable-diffusion.cpp:3576 - sampling using Euler method
    [INFO ] src\denoiser.hpp:494  - get_sigmas with discrete scheduler
    [INFO ] stable-diffusion.cpp:3703 - TXT2IMG
    [INFO ] stable-diffusion.cpp:3317 - get_learned_condition completed, taking 273 ms
    [INFO ] stable-diffusion.cpp:3428 - generating image: 1/1 - seed 11851
      |==================================================| 8/8 - 4.19s/it
    [INFO ] stable-diffusion.cpp:3470 - sampling completed, taking 33.60s
    [INFO ] stable-diffusion.cpp:3481 - generating 1 latent images completed, taking 33.60s
    [INFO ] stable-diffusion.cpp:3484 - decoding 1 latents
    [INFO ] stable-diffusion.cpp:3494 - latent 1 decoded, taking 20.69s
    [INFO ] stable-diffusion.cpp:3498 - decode_first_stage completed, taking 20.69s
    [INFO ] stable-diffusion.cpp:1228 - diffusion_lora_models:
    [INFO ] src\lora.hpp:830  - (480 / 480) LoRA tensors have been applied, lora_file_path = F:\ai\stability-matrix\Data\Models\Lora\pixel_art_style_z_image_turbo.safetensors
    [INFO ] stable-diffusion.cpp:3811 - generate_image completed in 55.45s
  7. renanklehm commented on Apr 13, 2026

    @renanklehm

    Any news on this subject? I can confirm that LoRA tags are not working on server

  8. wbruna commented on Apr 14, 2026

    @wbruna
    Contributor

    About the LoRA tags: #1156 (comment)

  9. NovNovikov commented on May 10, 2026

    @NovNovikov

    So, judging by the code and comments in it - it is intentionally made unusable and not compatible with cli and automatic1111 prompt logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions