Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ int main(int argc, const char** argv) {
gen_params.height = height;
gen_params.batch_count = n;

// Correctly set cfg_scale in the guidance parameters
gen_params.sample_params.guidance.txt_cfg = j.value("cfg_scale", gen_params.sample_params.guidance.txt_cfg);

if (!sd_cpp_extra_args_str.empty() && !gen_params.from_json_str(sd_cpp_extra_args_str)) {
res.status = 400;
res.set_content(R"({"error":"invalid sd_cpp_extra_args"})", "application/json");
Expand Down Expand Up @@ -810,6 +813,9 @@ int main(int argc, const char** argv) {
gen_params.sample_params.sample_steps = steps;
gen_params.batch_count = batch_size;

// set cfg_scale in the guidance parameters
gen_params.sample_params.guidance.txt_cfg = cfg_scale;

if (clip_skip > 0) {
gen_params.clip_skip = clip_skip;
}
Expand Down
2 changes: 1 addition & 1 deletion ggml
Submodule ggml updated 208 files
49 changes: 49 additions & 0 deletions sd_completions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
_sd_completions() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"

opts="-diffusion -cli -o --output -style --preview-path --preview-interval --output-begin-idx -negative --canny --convert-name -v --verbose --color --taesd-preview-only --preview --preview-noisy --mode --preview -h --help -m --model --clip -l --clip -g --clip -vision --t --llm -image -small --llm --qwen --llm --qwen --llm --diffusion-model --high-noise-diffusion-model --vae --taesd --tae --taesd --control-net --embd-dir --lora-model-dir --tensor-type-rules --photo-maker --upscale-model -t --threads --chroma-t -mask-pad --vae-tile-overlap --flow-shift --vae-tiling --force-sdxl-vae-conv-scale --offload-to-cpu --mmap -map --control-net-cpu --clip-on-cpu --vae-on-cpu --diffusion-fa --diffusion-conv-direct --vae-conv-direct --circular --circularx -axis --circulary -axis --chroma-disable-dit-mask --qwen-image-zero-cond-t --chroma-enable-t -mask --type --rng -webui --sampler-rng --rng --prediction --lora-apply-mode --vae-tile-size --vae-relative-tile-size --vae-tile-size -p --prompt -n --negative-prompt -i --init-img --end-img --mask --control-image --control-video --pm-id-images-dir --pm-id-embed-path --height --width --steps --high-noise-steps --clip-skip -b --batch-count --video-frames --fps --timestep-shift --upscale-repeats --upscale-tile-size --cfg-scale --img-cfg-scale -pix --cfg-scale --guidance --slg-scale --skip-layer-start --skip-layer-end --eta --high-noise-cfg-scale --high-noise-img-cfg-scale -pix --cfg-scale --high-noise-guidance --high-noise-slg-scale --high-noise-skip-layer-start --high-noise-skip-layer-end --high-noise-eta --strength --pm-style-strength --control-strength --moe-boundary --high-noise-steps --vace-strength --increase-ref-index --disable-auto-resize-ref-image -s --seed --sampling-method --high-noise-sampling-method --scheduler --sigmas -separated --skip-layers --high-noise-skip-layers -r --ref-image --cache-mode -dit -level --cache-option -separated -dit --cache-preset -dit --scm-mask -dit -separated --scm-policy"

case "$prev" in
--diffusion-model)
COMPREPLY=( $(compgen -f -X '!*.gguf' -- "$cur") $(compgen -d -- "$cur") )
return 0
;;
-m)
COMPREPLY=( $(compgen -f -X '!*.safetensors' -- "$cur") $(compgen -d -- "$cur") )
return 0
;;
*)
COMPREPLY=( $(compgen -W "${opts}" -- "$cur") )
return 0
;;
esac
}
_sd_server_comps() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"

opts="-diffusion -server -l --listen-ip --serve-html-path --listen-port -v --verbose --color -h --help -m --model --clip -l --clip -g --clip -vision --t --llm -image -small --llm --qwen --llm --qwen --llm --diffusion-model --high-noise-diffusion-model --vae --taesd --tae --taesd --control-net --embd-dir --lora-model-dir --tensor-type-rules --photo-maker --upscale-model -t --threads --chroma-t -mask-pad --vae-tile-overlap --flow-shift --vae-tiling --force-sdxl-vae-conv-scale --offload-to-cpu --mmap -map --control-net-cpu --clip-on-cpu --vae-on-cpu --diffusion-fa --diffusion-conv-direct --vae-conv-direct --circular --circularx -axis --circulary -axis --chroma-disable-dit-mask --qwen-image-zero-cond-t --chroma-enable-t -mask --type --rng -webui --sampler-rng --rng --prediction --lora-apply-mode --vae-tile-size --vae-relative-tile-size --vae-tile-size -p --prompt -n --negative-prompt -i --init-img --end-img --mask --control-image --control-video --pm-id-images-dir --pm-id-embed-path --height --width --steps --high-noise-steps --clip-skip -b --batch-count --video-frames --fps --timestep-shift --upscale-repeats --upscale-tile-size --cfg-scale --img-cfg-scale -pix --cfg-scale --guidance --slg-scale --skip-layer-start --skip-layer-end --eta --high-noise-cfg-scale --high-noise-img-cfg-scale -pix --cfg-scale --high-noise-guidance --high-noise-slg-scale --high-noise-skip-layer-start --high-noise-skip-layer-end --high-noise-eta --strength --pm-style-strength --control-strength --moe-boundary --high-noise-steps --vace-strength --increase-ref-index --disable-auto-resize-ref-image -s --seed --sampling-method --high-noise-sampling-method --scheduler --sigmas -separated --skip-layers --high-noise-skip-layers -r --ref-image --cache-mode -dit -level --cache-option -separated -dit --cache-preset -dit --scm-mask -dit -separated --scm-policy"

case "$prev" in
--diffusion-model)
COMPREPLY=( $(compgen -f -X '!*.gguf' -- "$cur") $(compgen -d -- "$cur") )
return 0
;;
-m)
COMPREPLY=( $(compgen -f -X '!*.safetensors' -- "$cur") $(compgen -d -- "$cur") )
return 0
;;
*)
COMPREPLY=( $(compgen -W "${opts}" -- "$cur") )
return 0
;;
esac
}

complete -F _sd_completions sd-cli
complete -F _sd_server_comps sd-server
32 changes: 32 additions & 0 deletions up
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
#echo export CUDAHOSTCXX=g++-13 #>> .bashrc
#!/bin/bash

# 1. Store the current commit hash
OLD_COMMIT=$(git rev-parse HEAD)

echo "Current commit: $OLD_COMMIT"

# 2. Perform the git pull
# Using '|| exit' ensures the script stops if the pull command itself fails
git pull || { echo "git pull failed"; exit 1; }

# 3. Store the new commit hash
NEW_COMMIT=$(git rev-parse HEAD)

echo "New commit: $NEW_COMMIT"

# 4. Compare the hashes
if [ "$OLD_COMMIT" != "$NEW_COMMIT" ]; then
echo "Repository updated with new commits."
# --- PLACE YOUR COMMANDS HERE ---

cmake -B build -DSD_CUDA=ON -DCMAKE_CXX_FLAGS="-w"
cmake --build . --config Release
cmake --install build --prefix $HOME/.local

#cmake -B build -DGGML_BLAS=1 -DGGML_BLAS_VENDOR=OpenBLAS -j8

else
echo "Repository was already up-to-date."
fi