Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with smaller images #24

Closed
Tracked by #122
fwsGonzo opened this issue Aug 22, 2023 · 2 comments
Closed
Tracked by #122

Problems with smaller images #24

fwsGonzo opened this issue Aug 22, 2023 · 2 comments

Comments

@fwsGonzo
Copy link

fwsGonzo commented Aug 22, 2023

Hey, I am using this repo successfully in a very strange single-threaded environment, and it's working. Great work! I really love the idea of a CPU-based generator that can be both single-threaded and statically built. One problem that I have though is that images smaller than 512x512 seems to be failing all the time. This issue also happens in a regular Linux terminal. Example:

$ ./build/bin/sd -m models/sd-v1-4-ggml-model-q4_1.bin -W 256 -H 256 --seed 42 --steps 12 -p "A lovely cat, high quality" -o 
sd.png

Option: 
    n_threads:       16
    mode:            txt2img
    model_path:      models/sd-v1-4-ggml-model-q4_1.bin
    output_path:     sd.png
    init_img:        
    prompt:          A lovely cat, high quality
    negative_prompt: 
    cfg_scale:       7.00
    width:           128
    height:          128
    sample_method:   eular a
    sample_steps:    12
    strength:        0.75
    seed:            42
System Info: 
    BLAS = 0
    SSE3 = 1
    AVX = 1
    AVX2 = 1
    AVX512 = 0
    AVX512_VBMI = 0
    AVX512_VNNI = 0
    FMA = 1
    NEON = 0
    ARM_FMA = 0
    F16C = 1
    FP16_VA = 0
    WASM_SIMD = 0
    VSX = 0

sd

$ ./build/bin/sd -m models/sd-v1-4-ggml-model-q4_1.bin -W 128 -H 128 --seed 42 --steps 12 -p "A lovely cat, high quality" -o sd.png

sd

$ ./build/bin/sd -v -m models/sd-v1-4-ggml-model-q4_1.bin -W 512 -H 512 --seed 42 --steps 12 -p "A lovely cat, high quality" -o sd.png

sd

These images were created on my AMD Ryzen 9 7950X machine. I am looking into this problem now, just creating this issue to track the problem.

Changing models doesn't help. I am experimenting with -march settings now.

@ClashSAN
Copy link

It's the model itself, test: you'll see this is the same across different libraries.

Only certain finetuned models work well at a smaller size:

cat2

these seem to work well at that range:

https://huggingface.co/justinpinkney/miniSD/blob/main/miniSD.ckpt
https://huggingface.co/cag/anything-v3-1/blob/main/anything-v3-1.ckpt

But just like generating 512x512 with the base sdxl model produces bad images, generating with 192x192 or below often won't work out, try 384x384 with the base model.

@fwsGonzo
Copy link
Author

Thanks, that was the solution. It works well now! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants