Comments (10)
I'm willing to implement SDXL once I've improved the support for SD 1.x and added support for SD 2.x.
from stable-diffusion.cpp.
Beside LCM being available for XL models, stability.ai released SDXL-turbo a destil(finetune?) that can generate good images with a single step.
https://huggingface.co/stabilityai/sdxl-turbo
from stable-diffusion.cpp.
@leejet this can be closed
Generally, I don't proactively close issues unless they've been resolved for an extended period without any response from the person who opened the issue. I prefer the individuals who opened the issue to confirm its resolution and close it themselves.
from stable-diffusion.cpp.
@ranjithum The VAE in SDXL encounters NaN issues under FP16, but unfortunately, the ggml_conv_2d only operates under FP16. Hence, a parameter is needed to specify the VAE that has fixed the FP16 NaN issue. You can find it here: SDXL VAE FP16 Fix.
./bin/sd -m ../models/sd_xl_base_1.0.safetensors --vae ../models/sdxl_vae-fp16-fix.safetensors -H 1024 -W 1024 -p "a lovely cat" -v
from stable-diffusion.cpp.
is is compatible with this repo?
from stable-diffusion.cpp.
@leejet this can be closed
from stable-diffusion.cpp.
@zhongwei Support for SDXL has been added. You can try pulling the latest code from the master branch.
from stable-diffusion.cpp.
Did anyone try running sd_xl ? For some reason its generating a empty image (its pitch black) .. Following is the command i used and its output
$ ./bin/sd -m ~/downloaded_models/sdxl-turbo/sd_xl_turbo_1.0_fp16.safetensors -p "a lovely cat"
[INFO] stable-diffusion.cpp:5386 - loading model from '~/downloaded_models/sdxl-turbo/sd_xl_turbo_1.0_fp16.safetensors'
[INFO] model.cpp:638 - load ~/downloaded_models/sdxl-turbo/sd_xl_turbo_1.0_fp16.safetensors using safetensors format
[INFO] stable-diffusion.cpp:5412 - Stable Diffusion XL
[INFO] stable-diffusion.cpp:5418 - Stable Diffusion weight type: f16
[INFO] stable-diffusion.cpp:5573 - total memory buffer size = 6570.56MB (clip 1565.66MB, unet 4909.43MB, vae 95.47MB)
[INFO] stable-diffusion.cpp:5579 - loading model from '~/downloaded_models/sdxl-turbo/sd_xl_turbo_1.0_fp16.safetensors' completed, taking 1.78s
[INFO] stable-diffusion.cpp:5593 - running in eps-prediction mode
[INFO] stable-diffusion.cpp:6486 - apply_loras completed, taking 0.00s
[INFO] stable-diffusion.cpp:6525 - get_learned_condition completed, taking 1547 ms
[INFO] stable-diffusion.cpp:6535 - sampling using Euler A method
[INFO] stable-diffusion.cpp:6539 - generating image: 1/1 - seed 42
|==================================================| 20/20 - 18.15s/it
[INFO] stable-diffusion.cpp:6551 - sampling completed, taking 353.73s
[INFO] stable-diffusion.cpp:6559 - generating 1 latent images completed, taking 353.89s
[INFO] stable-diffusion.cpp:6561 - decoding 1 latents
[INFO] stable-diffusion.cpp:6571 - latent 1 decoded, taking 17.36s
[INFO] stable-diffusion.cpp:6575 - decode_first_stage completed, taking 17.36s
[INFO] stable-diffusion.cpp:6590 - txt2img completed in 372.80s
[INFO] main.cpp:538 - save result image to 'output.png'
i also tried downloading the unets/vae etc.. and passing the same as argument (along with some minor code changes to load f16.safetensor instead of just .safetensor - std::string unet_path = path_join(file_path, "unet/diffusion_pytorch_model.safetensors");)
$ ./bin/sd -m ~/downloaded_models/sdxl-turbo/sd_xl_turbo_1.0_fp16.safetensors --vae ~/downloaded_models/sdxl-turbo/ -p "a lovely cat"
[INFO] stable-diffusion.cpp:5386 - loading model from '~/downloaded_models/sdxl-turbo/sd_xl_turbo_1.0_fp16.safetensors'
[INFO] model.cpp:638 - load ~/downloaded_models/sdxl-turbo/sd_xl_turbo_1.0_fp16.safetensors using safetensors format
[INFO] stable-diffusion.cpp:5395 - loading vae from '~/downloaded_models/sdxl-turbo/'
[INFO] model.cpp:632 - load ~/downloaded_models/sdxl-turbo/ using diffusers format
[INFO] stable-diffusion.cpp:5412 - Stable Diffusion XL
[INFO] stable-diffusion.cpp:5418 - Stable Diffusion weight type: f16
[WARN] stable-diffusion.cpp:5503 - unknown tensor 'unet.add_embedding.linear_1.bias' in model file
[WARN] stable-diffusion.cpp:5503 - unknown tensor 'unet.add_embedding.linear_1.weight' in model file
[WARN] stable-diffusion.cpp:5503 - unknown tensor 'unet.add_embedding.linear_2.bias' in model file
[WARN] stable-diffusion.cpp:5503 - unknown tensor 'unet.add_embedding.linear_2.weight' in model file
[WARN] stable-diffusion.cpp:5503 - unknown tensor 'model.diffusion_model.output_blocks.2.1.conv.bias' in model file
[WARN] stable-diffusion.cpp:5503 - unknown tensor 'model.diffusion_model.output_blocks.2.1.conv.weight' in model file
[INFO] stable-diffusion.cpp:5573 - total memory buffer size = 6570.56MB (clip 1565.66MB, unet 4909.43MB, vae 95.47MB)
[INFO] stable-diffusion.cpp:5579 - loading model from '~/downloaded_models/sdxl-turbo/sd_xl_turbo_1.0_fp16.safetensors' completed, taking 2.61s
[INFO] stable-diffusion.cpp:5593 - running in eps-prediction mode
[INFO] stable-diffusion.cpp:6486 - apply_loras completed, taking 0.00s
[INFO] stable-diffusion.cpp:6525 - get_learned_condition completed, taking 1592 ms
[INFO] stable-diffusion.cpp:6535 - sampling using Euler A method
[INFO] stable-diffusion.cpp:6539 - generating image: 1/1 - seed 42
|==================================================| 20/20 - 18.09s/it
[INFO] stable-diffusion.cpp:6551 - sampling completed, taking 353.85s
[INFO] stable-diffusion.cpp:6559 - generating 1 latent images completed, taking 353.85s
[INFO] stable-diffusion.cpp:6561 - decoding 1 latents
[INFO] stable-diffusion.cpp:6571 - latent 1 decoded, taking 17.08s
[INFO] stable-diffusion.cpp:6575 - decode_first_stage completed, taking 17.08s
[INFO] stable-diffusion.cpp:6590 - txt2img completed in 372.51s
[INFO] main.cpp:538 - save result image to 'output.png'
But its the same result.. i have tried the older stable diffusion - stable-diffusion-2-1/v2-1_768-nonema-pruned.safetensors
it works..
I m running on ubuntu 22.03.
from stable-diffusion.cpp.
@leejet - Perfect thanks.. It worked..
from stable-diffusion.cpp.
@leejet we should probably put up a warning in the program, when f32 vae is used. (until its fixed).
from stable-diffusion.cpp.
Related Issues (20)
- Strength value of image to image HOT 2
- Support Inpainting HOT 6
- Support tiling
- how to debug in vscode
- [featured] Support for Metal HOT 13
- [Feature Request] Embeddings like EasyNegative HOT 2
- Error with quantization and lora HOT 2
- Build fails on mingw
- Presets or enhancing output
- Generate another image without loading the model again HOT 3
- Is there anyone who can't generate images correctly? HOT 11
- Roop/Face Swap?
- UNet is not run with GPU HOT 6
- Metal build with SDXL-Turbo generates a black output image HOT 4
- Exception when delete StableDiffusion pointer HOT 2
- FreeU support HOT 8
- Flash attention abort trap HOT 9
- C-API export seems to not work correctly HOT 4
- std::set undefined HOT 1
- Can not release memory HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stable-diffusion.cpp.