Commit graph

124 commits

Author SHA1 Message Date
Wagner Bruna
d74c16e6e0
enable flash attention for image generation (#1633) 2025-07-05 11:20:51 +08:00
Concedo
186227fc26 sync with sd.cpp 2025-06-30 00:10:51 +08:00
Concedo
2594be7d4e fixed scaling behavior again 2025-06-29 11:36:38 +08:00
Concedo
2635e4b932 try fix segfault in sdcpp 2025-06-29 02:33:03 +08:00
Concedo
485148b293 fixed sdmain compiling 2025-06-28 23:19:13 +08:00
Concedo
6c92a9f0e1 fixed resizing 2025-06-28 23:10:04 +08:00
Concedo
a1175cf34f merged leejet changes 2025-06-28 22:57:07 +08:00
Concedo
4ec0e0fd21 now accept multiple images for reference images 2025-06-28 17:30:28 +08:00
Concedo
ff2cabc28f fixed kontext and photomaker (+1 squashed commits)
Squashed commits:

[de0ac91dd] photomaker use 1 channel
2025-06-28 12:14:05 +08:00
Concedo
5a6cc38f35 fixed a typo 2025-06-28 11:47:07 +08:00
Concedo
ed289227e5 added support for flux kontext 2025-06-28 11:37:19 +08:00
Concedo
0bd648ffa4 photomaker renamed to extra image to handle future extension 2025-06-28 10:26:06 +08:00
Concedo
6039791adf minor bugfixes 2025-06-21 18:41:28 +08:00
Wagner Bruna
08adfb53c9
Configurable VAE threshold limit (#1601)
* add backend support for changing the VAE tiling threshold

* trigger VAE tiling by image area instead of dimensions

I've tested with GGML_VULKAN_MEMORY_DEBUG all resolutions with
the same 768x768 area (even extremes like 64x9216), and many
below that: all consistently allocate 6656 bytes per image pixel.
As tiling is primarily useful to avoid excessive memory usage, it
seems reasonable to enable VAE tiling based on area rather than
maximum image side.

However, as there is currently no user interface option to change
it back to a lower value, it's best to maintain the default
behavior for now.

* replace the notile option with a configurable threshold

This allows selecting a lower threshold value, reducing the
peak memory usage.

The legacy sdnotile parameter gets automatically converted to
the new parameter, if it's the only one supplied.

* simplify tiling checks, 768 default visible in launcher

---------

Co-authored-by: Concedo <39025047+LostRuins@users.noreply.github.com>
2025-06-21 10:14:57 +08:00
Concedo
caea52407a fix photomaker crash 2025-06-21 10:11:39 +08:00
Concedo
ce58d1253f fixed build and workflow 2025-06-21 00:56:27 +08:00
Concedo
2ba7803b95 replace_instruct_placeholders is now default 2025-06-20 22:11:58 +08:00
Concedo
4e40f2aaf4 added photomaker face cloning 2025-06-20 21:33:36 +08:00
Concedo
21881a861d rename restrict square to sdclampedsoft 2025-06-20 15:39:55 +08:00
Concedo
175c99081e merged https://github.com/leejet/stable-diffusion.cpp/issues/588 to fix vae tiling, ref https://github.com/LostRuins/koboldcpp/issues/1603 2025-06-20 11:13:04 +08:00
Concedo
e35c6b8f9b remove t5 masking sdcpp 2025-06-18 21:05:03 +08:00
Concedo
40443a98f5 show available RAM, fixed SD vae tiling noise 2025-06-18 18:44:50 +08:00
Concedo
bfb47cbcd8 Revert "revert padding change for sd chroma"
This reverts commit 7de88802f9.
2025-06-14 10:10:34 +08:00
Wagner Bruna
f6d2d1ce5c
configurable resolution limit (#1586)
* refactor image gen configuration screen

* make image size limit configurable

* fix resolution limits and keep dimensions closer to the original ratio

* use 0.0 for the configured default image size limit

This prevents the current default value from being saved into the
config files, in case we later decide to adopt a different value.

* export image model version when loading

* restore model-specific default image size limit

* change the image area restriction to be specified by a square side

* move image resolution limits down to the C++ level

* Revert "export image model version when loading"

This reverts commit fa65b23de3.

* Linting Fixes:
PY:
- Inconsistent var name sd_restrict_square -> sd_restrict_square_var
- GUI swap back to using absolute row numbers for now.
- fstring fix
- size_limit -> side_limit inconsistency
C++:
- roundup_64 standalone function
- refactor sd_fix_resolution variable names for clarity
- move "anti crashing" hard total megapixel limit always to be applied after soft total megapixel limit instead of conditionally only when sd_restrict_square is unset

* allow unsafe resolutions if debugmode is on

---------

Co-authored-by: Concedo <39025047+LostRuins@users.noreply.github.com>
2025-06-13 20:05:20 +08:00
Concedo
7de88802f9 revert padding change for sd chroma 2025-06-08 23:48:46 +08:00
Concedo
2d4c1aa5a0 chroma support is now usable 2025-06-08 18:53:59 +08:00
Concedo
30cf433ab4 merge base support for chroma, however its not working correctly 2025-06-08 18:06:23 +08:00
Concedo
b08dca65ed Merge branch 'upstream' into concedo_experimental
# Conflicts:
#	common/CMakeLists.txt
#	common/arg.cpp
#	common/chat.cpp
#	examples/parallel/README.md
#	examples/parallel/parallel.cpp
#	ggml/cmake/common.cmake
#	ggml/src/CMakeLists.txt
#	ggml/src/ggml-cpu/CMakeLists.txt
#	ggml/src/ggml-sycl/ggml-sycl.cpp
#	ggml/src/ggml-sycl/rope.cpp
#	models/ggml-vocab-bert-bge.gguf.inp
#	models/ggml-vocab-bert-bge.gguf.out
#	models/ggml-vocab-command-r.gguf.inp
#	models/ggml-vocab-command-r.gguf.out
#	models/ggml-vocab-deepseek-coder.gguf.inp
#	models/ggml-vocab-deepseek-coder.gguf.out
#	models/ggml-vocab-deepseek-llm.gguf.inp
#	models/ggml-vocab-deepseek-llm.gguf.out
#	models/ggml-vocab-falcon.gguf.inp
#	models/ggml-vocab-falcon.gguf.out
#	models/ggml-vocab-gpt-2.gguf.inp
#	models/ggml-vocab-gpt-2.gguf.out
#	models/ggml-vocab-llama-bpe.gguf.inp
#	models/ggml-vocab-llama-bpe.gguf.out
#	models/ggml-vocab-llama-spm.gguf.inp
#	models/ggml-vocab-llama-spm.gguf.out
#	models/ggml-vocab-mpt.gguf.inp
#	models/ggml-vocab-mpt.gguf.out
#	models/ggml-vocab-phi-3.gguf.inp
#	models/ggml-vocab-phi-3.gguf.out
#	models/ggml-vocab-qwen2.gguf.inp
#	models/ggml-vocab-qwen2.gguf.out
#	models/ggml-vocab-refact.gguf.inp
#	models/ggml-vocab-refact.gguf.out
#	models/ggml-vocab-starcoder.gguf.inp
#	models/ggml-vocab-starcoder.gguf.out
#	requirements/requirements-gguf_editor_gui.txt
#	tests/CMakeLists.txt
#	tests/test-chat.cpp
#	tests/test-grammar-integration.cpp
#	tests/test-json-schema-to-grammar.cpp
#	tools/mtmd/CMakeLists.txt
#	tools/run/run.cpp
#	tools/server/CMakeLists.txt
2025-05-31 13:04:21 +08:00
Wagner Bruna
12f99ba907
fix: workaround for default clip_skip issues (#1572)
Sets the clip_skip value explicitly to 1 or 2 for all generation
requests, aligning with the tests in the Conditioner objects in
conditioner.hpp.

This should fix #1546 regardless of future changes to the default
behavior of sdcpp. This workaround can be removed once a proper
fix is implemented in sdcpp.
2025-05-31 10:36:30 +08:00
Concedo
a11ab0b08e reverse clip skip fix as it might be breaking some sdxl models 2025-05-30 10:40:03 +08:00
Concedo
26bf5b446d fixed thread count <=0 , fixed clip skip <= 0 2025-05-28 00:38:15 +08:00
Concedo
499283c63a rename define to match upstream 2025-05-23 17:10:12 +08:00
Concedo
e68a5f448c add ddim sampler 2025-05-22 21:28:01 +08:00
Wagner Bruna
7dc3e3e64b
store clip skip value on generated images (#1551) 2025-05-21 23:37:48 +08:00
Concedo
f841b29c41 fixed unicode paths 2025-05-11 14:05:54 +08:00
Concedo
c2802af9e8 fix qwen3, fixed sd, fixed glm4 2025-04-29 20:50:46 +08:00
Concedo
cbdee99354 revert sdcpp clip quant changes 2025-04-17 11:11:34 +08:00
Concedo
b2719268df merge sdcpp fixes 2025-04-17 00:52:49 +08:00
Concedo
fe12b1cbd4 fixed lora, now works quanted too 2025-04-14 23:44:42 +08:00
Concedo
2d0b7e37f9 fix build 2025-04-13 22:01:48 +08:00
Concedo
7e1289ade8 fixes for sdcpp 2025-04-12 10:08:23 +08:00
Concedo
8acec907bb revert sbti image write 2025-04-10 10:43:24 +08:00
Concedo
27f575dc83 inpaining support completed, invert mask added 2025-04-09 23:50:17 +08:00
Concedo
23339ace9b inpainting works in kcpp! 2025-04-09 23:01:05 +08:00
Concedo
fea3b2bd4a updated sdcpp prepare for inpaint
fixed img2img (+1 squashed commits)

Squashed commits:

[42c48f14] try update sdcpp, feels kind of buggy
2025-04-09 20:26:10 +08:00
Concedo
e466ce65e2 updated sd metadata 2025-03-16 20:12:43 +08:00
Concedo
bfc30066c9 fixed a clip processing bug 2025-03-15 17:49:49 +08:00
Concedo
ca698f0cbe tweaked sd img metadata 2025-03-13 20:04:29 +08:00
Wagner Bruna
5413be2c1b
sd: add generation parameters to image metadata (#1416)
Straight adaptation from stable-diffusion.cpp main.cpp.
2025-03-13 19:35:06 +08:00
Concedo
5f74ee3c3b merge sd fix 2025-02-21 11:16:26 +08:00