Comments (10)
Nice to know we're thinking alike! I just added support for the Latent Consistency Models Sampler, as mentioned here: #76 (comment). Currently, I'm working on implementing support for lora, similar to sd-webui. Once that's done, lcm-lora will also be available. It's almost complete, and I expect to finish it in the next day or two.
from stable-diffusion.cpp.
I just added LoRA support, now we can specify the use of LCM-LoRA through the prompt. Any SD1.x model should be adaptable.
https://github.com/leejet/stable-diffusion.cpp#with-lora
Here's a simple example:
./bin/sd -m ../models/v1-5-pruned-emaonly-ggml-model-f16.bin -p "a lovely cat<lora:lcm-lora-sdv1-5:1>" --steps 4 --lora-model-dir ../models -v --cfg-scale 1
from stable-diffusion.cpp.
Nice to know we're thinking alike! I just added support for the Latent Consistency Models Sampler, as mentioned here: #76 (comment). Currently, I'm working on implementing support for lora, similar to sd-webui. Once that's done, lcm-lora will also be available. It's almost complete, and I expect to finish it in the next day or two.
I just wanted to talk to you about changing the project structure to fully support the gguf format and applying the structure used by other projects that use ggml, like llama.cpp and whisper.cpp. This should allow having a general struct sd_context
, unet_model
, autoencoder_kl
clip_text_model
, sd_model_loader
sd_sample
to decouple each component.
// general full loader
sd_load_model(sd_context* ctx, const char* file_name);
// for custom unets
sd_load_unet(sd_context* ctx, ...
// custom vae
sd_load_vae(sd_context* ctx, ...
sd_load_lora(sd_context* ctx,
sd_model_loader* loader, const char* file_name, float strenght);
I have also conducted research on LoRA that could be helpful to you for both LoRA and SDXL support. Please review the code of my pull request.
from stable-diffusion.cpp.
lcm-lora will also be available. It's almost complete, and I expect to finish it in the next day or two.
that is some big news :)
from stable-diffusion.cpp.
@FSSRepo I've replied within your pull request. Sorry for the delayed response, I've been busy with work recently.
from stable-diffusion.cpp.
I just added LoRA support, now we can specify the use of LCM-LoRA through the prompt. Any SD1.x model should be adaptable.
https://github.com/leejet/stable-diffusion.cpp#with-lora
I will adapt your code for the PR, just the loader, I just need to offload the encoder phase of VAE to the GPU, although it requires me to create a function in ggml to pad the data in a tensor and create it's kernels. because ggml_map_custom cannot interact directly with the data when the CUDA Backend is used.'
from stable-diffusion.cpp.
I will adapt your code for the PR.
Since you opened the PR, there have been several updates in my master branch. I'd appreciate it if you could rebase your branch onto my master to integrate these changes, rather than straightforwardly copying the code. This will streamline conflict resolution when merging your PR.
No problem!
from stable-diffusion.cpp.
I will adapt your code for the PR.
Since you opened the PR, there have been several updates in my master branch. I'd appreciate it if you could rebase your branch onto my master to integrate these changes, rather than straightforwardly copying the code. This will streamline conflict resolution when merging your PR.
from stable-diffusion.cpp.
@leejet Why use these asserts? Since sizeof(nb[0])
measures the size of the type, which is size_t nb
and is 8, it is not the same as float.
static void asymmetric_pad(struct ggml_tensor* dst,
const struct ggml_tensor* a,
const struct ggml_tensor* b,
int ith,
int nth,
void* userdata) {
assert(sizeof(dst->nb[0]) == sizeof(float));
assert(sizeof(a->nb[0]) == sizeof(float));
assert(sizeof(b->nb[0]) == sizeof(float));
Fix:
assert(dst->nb[0] == sizeof(float));
assert(a->nb[0] == sizeof(float));
assert(b->nb[0] == sizeof(float));
Cannot accept the latest master changes because it would overwrite the ggml submodule from mine to yours if I force the rebase.
from stable-diffusion.cpp.
Closed by #75 (full tested LoRA Loader)
from stable-diffusion.cpp.
Related Issues (20)
- 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
- Stable Diffusion with LCM on Mac OS(Metal) produces black image HOT 1
- Metal backend doesn't gain a speed bonus from running with half precision HOT 1
- Problems with function "ggml_quantize_chunk" on M1 in ggml.c HOT 1
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.