Skip to content

[Bug] Wrong output filename in sd-cli if the argument of -o option ends with a number #1244

@ZahyGabi

Description

@ZahyGabi

Git commit

$ sd-cli --version
stable-diffusion.cpp version master-675208d-221-ge411520, commit e411520

Operating System & Version

FreeBSD 15.x

GGML backends

CPU

Command-line arguments used

sd --cfg-scale 1 --steps 1 -m SD/sdxs.safetensors -p 'a cute puppy' -o cute.dog.5

Steps to reproduce

$ sd-cli --cfg-scale 1 --steps 1 -m SD/sdxs.safetensors -p 'a cute puppy' -o cute.dog.5
[INFO ] stable-diffusion.cpp:251 - loading model from 'SD/sdxs.safetensors'
[INFO ] model.cpp:373 - load SD/sdxs.safetensors using safetensors format
[INFO ] stable-diffusion.cpp:335 - Version: SDXS
[INFO ] stable-diffusion.cpp:363 - Weight type stat: f16: 610
[INFO ] stable-diffusion.cpp:364 - Conditioner weight type stat: f16: 196
[INFO ] stable-diffusion.cpp:365 - Diffusion model weight type stat: f16: 280
[INFO ] stable-diffusion.cpp:366 - VAE weight type stat: f16: 134
|==================================================| 610/610 - 1521.20it/s
[INFO ] model.cpp:1629 - loading tensors completed, taking 0.40s (process: 0.00s, read: 0.34s, memcpy: 0.00s, convert: 0.00s, copy_to_backend: 0.00s)
[INFO ] stable-diffusion.cpp:860 - total params memory size = 840.00MB (VRAM 0.00MB, RAM 840.00MB): text_encoders 235.06MB(RAM), diffusion_model 602.60MB(RAM), vae 2.34MB(RAM), controlnet 0.00MB(VRAM), pmid 0.00MB(RAM)
[INFO ] stable-diffusion.cpp:918 - running in eps-prediction mode
[INFO ] stable-diffusion.cpp:3506 - sampling using Euler A method
[INFO ] denoiser.hpp:403 - get_sigmas with discrete scheduler
[INFO ] stable-diffusion.cpp:3633 - TXT2IMG
[INFO ] stable-diffusion.cpp:3250 - get_learned_condition completed, taking 341 ms
[INFO ] stable-diffusion.cpp:3361 - generating image: 1/1 - seed 42
|==================================================| 1/1 - 8.19s/it
[INFO ] stable-diffusion.cpp:3403 - sampling completed, taking 8.21s
[INFO ] stable-diffusion.cpp:3414 - generating 1 latent images completed, taking 8.25s
[INFO ] stable-diffusion.cpp:3417 - decoding 1 latents
[INFO ] stable-diffusion.cpp:3427 - latent 1 decoded, taking 5.77s
[INFO ] stable-diffusion.cpp:3431 - decode_first_stage completed, taking 5.78s
[INFO ] stable-diffusion.cpp:3741 - generate_image completed in 14.37s
[INFO ] main.cpp:421 - save result image 0 to 'cute.dog.png' (success)

What you expected to happen

The filename should be cute.dog.5.png

What actually happened

The number stripped from the filename.

Logs / error messages / stack trace

No response

Additional context / environment details

No response

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