mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-01-02 10:43:35 +00:00
feat: simple openai image generation api compatiple server (#1037)
This commit is contained in:
parent
11ab095230
commit
2aecdd57ca
@ -17,6 +17,6 @@ RUN apt-get update && \
|
|||||||
apt-get install --yes --no-install-recommends libgomp1 && \
|
apt-get install --yes --no-install-recommends libgomp1 && \
|
||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
COPY --from=build /sd.cpp/build/bin/sd /sd
|
COPY --from=build /sd.cpp/build/bin/sd-cli /sd-cli
|
||||||
|
|
||||||
ENTRYPOINT [ "/sd" ]
|
ENTRYPOINT [ "/sd-cli" ]
|
||||||
@ -18,6 +18,6 @@ RUN mkdir build && cd build && \
|
|||||||
|
|
||||||
FROM mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64 as runtime
|
FROM mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64 as runtime
|
||||||
|
|
||||||
COPY --from=build /sd.cpp/build/bin/sd /sd
|
COPY --from=build /sd.cpp/build/bin/sd-cli /sd-cli
|
||||||
|
|
||||||
ENTRYPOINT [ "/sd" ]
|
ENTRYPOINT [ "/sd-cli" ]
|
||||||
@ -14,6 +14,6 @@ RUN mkdir build && cd build && \
|
|||||||
|
|
||||||
FROM intel/oneapi-basekit:${SYCL_VERSION}-devel-ubuntu24.04 AS runtime
|
FROM intel/oneapi-basekit:${SYCL_VERSION}-devel-ubuntu24.04 AS runtime
|
||||||
|
|
||||||
COPY --from=build /sd.cpp/build/bin/sd /sd
|
COPY --from=build /sd.cpp/build/bin/sd-cli /sd-cli
|
||||||
|
|
||||||
ENTRYPOINT [ "/sd" ]
|
ENTRYPOINT [ "/sd-cli" ]
|
||||||
|
|||||||
@ -114,7 +114,7 @@ API and command-line option may change frequently.***
|
|||||||
### Generate an image with just one command
|
### Generate an image with just one command
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./bin/sd -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat"
|
./bin/sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat"
|
||||||
```
|
```
|
||||||
|
|
||||||
***For detailed command-line arguments, check out [cli doc](./examples/cli/README.md).***
|
***For detailed command-line arguments, check out [cli doc](./examples/cli/README.md).***
|
||||||
|
|||||||
@ -15,7 +15,7 @@ You can run Chroma using stable-diffusion.cpp with a GPU that has 6GB or even 4G
|
|||||||
You can download the preconverted gguf weights from [silveroxides/Chroma-GGUF](https://huggingface.co/silveroxides/Chroma-GGUF), this way you don't have to do the conversion yourself.
|
You can download the preconverted gguf weights from [silveroxides/Chroma-GGUF](https://huggingface.co/silveroxides/Chroma-GGUF), this way you don't have to do the conversion yourself.
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M convert -m ..\..\ComfyUI\models\unet\chroma-unlocked-v40.safetensors -o ..\models\chroma-unlocked-v40-q8_0.gguf -v --type q8_0
|
.\bin\Release\sd-cli.exe -M convert -m ..\..\ComfyUI\models\unet\chroma-unlocked-v40.safetensors -o ..\models\chroma-unlocked-v40-q8_0.gguf -v --type q8_0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
@ -24,7 +24,7 @@ You can download the preconverted gguf weights from [silveroxides/Chroma-GGUF](h
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\models\chroma-unlocked-v40-q8_0.gguf --vae ..\models\ae.sft --t5xxl ..\models\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'chroma.cpp'" --cfg-scale 4.0 --sampling-method euler -v --chroma-disable-dit-mask --clip-on-cpu
|
.\bin\Release\sd-cli.exe --diffusion-model ..\models\chroma-unlocked-v40-q8_0.gguf --vae ..\models\ae.sft --t5xxl ..\models\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'chroma.cpp'" --cfg-scale 4.0 --sampling-method euler -v --chroma-disable-dit-mask --clip-on-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\Chroma1-Radiance-v0.4-Q8_0.gguf --t5xxl ..\..\ComfyUI\models\clip\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'chroma radiance cpp'" --cfg-scale 4.0 --sampling-method euler -v
|
.\bin\Release\sd-cli.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\Chroma1-Radiance-v0.4-Q8_0.gguf --t5xxl ..\..\ComfyUI\models\clip\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'chroma radiance cpp'" --cfg-scale 4.0 --sampling-method euler -v
|
||||||
```
|
```
|
||||||
|
|
||||||
<img alt="Chroma1-Radiance" src="../assets/flux/chroma1-radiance.png" />
|
<img alt="Chroma1-Radiance" src="../assets/flux/chroma1-radiance.png" />
|
||||||
|
|||||||
@ -9,7 +9,7 @@ docker build -t sd .
|
|||||||
### Run
|
### Run
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker run -v /path/to/models:/models -v /path/to/output/:/output sd [args...]
|
docker run -v /path/to/models:/models -v /path/to/output/:/output sd-cli [args...]
|
||||||
# For example
|
# For example
|
||||||
# docker run -v ./models:/models -v ./build:/output sd -m /models/sd-v1-4.ckpt -p "a lovely cat" -v -o /output/output.png
|
# docker run -v ./models:/models -v ./build:/output sd-cli -m /models/sd-v1-4.ckpt -p "a lovely cat" -v -o /output/output.png
|
||||||
```
|
```
|
||||||
@ -5,5 +5,5 @@ You can use ESRGAN to upscale the generated images. At the moment, only the [Rea
|
|||||||
- Specify the model path using the `--upscale-model PATH` parameter. example:
|
- Specify the model path using the `--upscale-model PATH` parameter. example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sd -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat" --upscale-model ../models/RealESRGAN_x4plus_anime_6B.pth
|
sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat" --upscale-model ../models/RealESRGAN_x4plus_anime_6B.pth
|
||||||
```
|
```
|
||||||
|
|||||||
@ -17,7 +17,7 @@ You can download the preconverted gguf weights from [FLUX.1-dev-gguf](https://hu
|
|||||||
|
|
||||||
For example:
|
For example:
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M convert -m ..\..\ComfyUI\models\unet\flux1-dev.sft -o ..\models\flux1-dev-q8_0.gguf -v --type q8_0
|
.\bin\Release\sd-cli.exe -M convert -m ..\..\ComfyUI\models\unet\flux1-dev.sft -o ..\models\flux1-dev-q8_0.gguf -v --type q8_0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
@ -28,7 +28,7 @@ For example:
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\models\flux1-dev-q8_0.gguf --vae ..\models\ae.sft --clip_l ..\models\clip_l.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'flux.cpp'" --cfg-scale 1.0 --sampling-method euler -v --clip-on-cpu
|
.\bin\Release\sd-cli.exe --diffusion-model ..\models\flux1-dev-q8_0.gguf --vae ..\models\ae.sft --clip_l ..\models\clip_l.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'flux.cpp'" --cfg-scale 1.0 --sampling-method euler -v --clip-on-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
Using formats of different precisions will yield results of varying quality.
|
Using formats of different precisions will yield results of varying quality.
|
||||||
@ -44,7 +44,7 @@ Using formats of different precisions will yield results of varying quality.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\models\flux1-schnell-q8_0.gguf --vae ..\models\ae.sft --clip_l ..\models\clip_l.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'flux.cpp'" --cfg-scale 1.0 --sampling-method euler -v --steps 4 --clip-on-cpu
|
.\bin\Release\sd-cli.exe --diffusion-model ..\models\flux1-schnell-q8_0.gguf --vae ..\models\ae.sft --clip_l ..\models\clip_l.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'flux.cpp'" --cfg-scale 1.0 --sampling-method euler -v --steps 4 --clip-on-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
| q8_0 |
|
| q8_0 |
|
||||||
@ -60,7 +60,7 @@ Since many flux LoRA training libraries have used various LoRA naming formats, i
|
|||||||
- LoRA model from https://huggingface.co/XLabs-AI/flux-lora-collection/tree/main (using comfy converted version!!!)
|
- LoRA model from https://huggingface.co/XLabs-AI/flux-lora-collection/tree/main (using comfy converted version!!!)
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\models\flux1-dev-q8_0.gguf --vae ...\models\ae.sft --clip_l ..\models\clip_l.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'flux.cpp'<lora:realism_lora_comfy_converted:1>" --cfg-scale 1.0 --sampling-method euler -v --lora-model-dir ../models --clip-on-cpu
|
.\bin\Release\sd-cli.exe --diffusion-model ..\models\flux1-dev-q8_0.gguf --vae ...\models\ae.sft --clip_l ..\models\clip_l.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'flux.cpp'<lora:realism_lora_comfy_converted:1>" --cfg-scale 1.0 --sampling-method euler -v --lora-model-dir ../models --clip-on-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\flux2-dev-Q4_K_S.gguf --vae ..\..\ComfyUI\models\vae\flux2_ae.safetensors --llm ..\..\ComfyUI\models\text_encoders\Mistral-Small-3.2-24B-Instruct-2506-Q4_K_M.gguf -r .\kontext_input.png -p "change 'flux.cpp' to 'flux2-dev.cpp'" --cfg-scale 1.0 --sampling-method euler -v --diffusion-fa --offload-to-cpu
|
.\bin\Release\sd-cli.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\flux2-dev-Q4_K_S.gguf --vae ..\..\ComfyUI\models\vae\flux2_ae.safetensors --llm ..\..\ComfyUI\models\text_encoders\Mistral-Small-3.2-24B-Instruct-2506-Q4_K_M.gguf -r .\kontext_input.png -p "change 'flux.cpp' to 'flux2-dev.cpp'" --cfg-scale 1.0 --sampling-method euler -v --diffusion-fa --offload-to-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
<img alt="flux2 example" src="../assets/flux2/example.png" />
|
<img alt="flux2 example" src="../assets/flux2/example.png" />
|
||||||
|
|||||||
@ -82,4 +82,4 @@ cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_H
|
|||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
```
|
```
|
||||||
|
|
||||||
If everything went OK, `build\bin\sd.exe` file should appear.
|
If everything went OK, `build\bin\sd-cli.exe` file should appear.
|
||||||
|
|||||||
@ -16,7 +16,7 @@ You can run Kontext using stable-diffusion.cpp with a GPU that has 6GB or even 4
|
|||||||
You can download the preconverted gguf weights from [FLUX.1-Kontext-dev-GGUF](https://huggingface.co/QuantStack/FLUX.1-Kontext-dev-GGUF), this way you don't have to do the conversion yourself.
|
You can download the preconverted gguf weights from [FLUX.1-Kontext-dev-GGUF](https://huggingface.co/QuantStack/FLUX.1-Kontext-dev-GGUF), this way you don't have to do the conversion yourself.
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M convert -m ..\..\ComfyUI\models\unet\flux1-kontext-dev.safetensors -o ..\models\flux1-kontext-dev-q8_0.gguf -v --type q8_0
|
.\bin\Release\sd-cli.exe -M convert -m ..\..\ComfyUI\models\unet\flux1-kontext-dev.safetensors -o ..\models\flux1-kontext-dev-q8_0.gguf -v --type q8_0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
@ -27,7 +27,7 @@ You can download the preconverted gguf weights from [FLUX.1-Kontext-dev-GGUF](ht
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -r .\flux1-dev-q8_0.png --diffusion-model ..\models\flux1-kontext-dev-q8_0.gguf --vae ..\models\ae.sft --clip_l ..\models\clip_l.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -p "change 'flux.cpp' to 'kontext.cpp'" --cfg-scale 1.0 --sampling-method euler -v --clip-on-cpu
|
.\bin\Release\sd-cli.exe -r .\flux1-dev-q8_0.png --diffusion-model ..\models\flux1-kontext-dev-q8_0.gguf --vae ..\models\ae.sft --clip_l ..\models\clip_l.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -p "change 'flux.cpp' to 'kontext.cpp'" --cfg-scale 1.0 --sampling-method euler -v --clip-on-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
Here's a simple example:
|
Here's a simple example:
|
||||||
|
|
||||||
```
|
```
|
||||||
./bin/sd -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat<lora:lcm-lora-sdv1-5:1>" --steps 4 --lora-model-dir ../models -v --cfg-scale 1
|
./bin/sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat<lora:lcm-lora-sdv1-5:1>" --steps 4 --lora-model-dir ../models -v --cfg-scale 1
|
||||||
```
|
```
|
||||||
|
|
||||||
| without LCM-LoRA (--cfg-scale 7) | with LCM-LoRA (--cfg-scale 1) |
|
| without LCM-LoRA (--cfg-scale 7) | with LCM-LoRA (--cfg-scale 1) |
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
Here's a simple example:
|
Here's a simple example:
|
||||||
|
|
||||||
```
|
```
|
||||||
./bin/sd -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat<lora:marblesh:1>" --lora-model-dir ../models
|
./bin/sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat<lora:marblesh:1>" --lora-model-dir ../models
|
||||||
```
|
```
|
||||||
|
|
||||||
`../models/marblesh.safetensors` or `../models/marblesh.ckpt` will be applied to the model
|
`../models/marblesh.safetensors` or `../models/marblesh.ckpt` will be applied to the model
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ovis_image-Q4_0.gguf --vae ..\..\ComfyUI\models\vae\ae.sft --llm ..\..\ComfyUI\models\text_encoders\ovis_2.5.safetensors -p "a lovely cat" --cfg-scale 5.0 -v --offload-to-cpu --diffusion-fa
|
.\bin\Release\sd-cli.exe --diffusion-model ovis_image-Q4_0.gguf --vae ..\..\ComfyUI\models\vae\ae.sft --llm ..\..\ComfyUI\models\text_encoders\ovis_2.5.safetensors -p "a lovely cat" --cfg-scale 5.0 -v --offload-to-cpu --diffusion-fa
|
||||||
```
|
```
|
||||||
|
|
||||||
<img alt="ovis image example" src="../assets/ovis_image/example.png" />
|
<img alt="ovis image example" src="../assets/ovis_image/example.png" />
|
||||||
@ -27,7 +27,7 @@ If on low memory GPUs (<= 8GB), recommend running with ```--vae-on-cpu``` option
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bin/sd -m ../models/sdxlUnstableDiffusers_v11.safetensors --vae ../models/sdxl_vae.safetensors --photo-maker ../models/photomaker-v1.safetensors --pm-id-images-dir ../assets/photomaker_examples/scarletthead_woman -p "a girl img, retro futurism, retro game art style but extremely beautiful, intricate details, masterpiece, best quality, space-themed, cosmic, celestial, stars, galaxies, nebulas, planets, science fiction, highly detailed" -n "realistic, photo-realistic, worst quality, greyscale, bad anatomy, bad hands, error, text" --cfg-scale 5.0 --sampling-method euler -H 1024 -W 1024 --pm-style-strength 10 --vae-on-cpu --steps 50
|
bin/sd-cli -m ../models/sdxlUnstableDiffusers_v11.safetensors --vae ../models/sdxl_vae.safetensors --photo-maker ../models/photomaker-v1.safetensors --pm-id-images-dir ../assets/photomaker_examples/scarletthead_woman -p "a girl img, retro futurism, retro game art style but extremely beautiful, intricate details, masterpiece, best quality, space-themed, cosmic, celestial, stars, galaxies, nebulas, planets, science fiction, highly detailed" -n "realistic, photo-realistic, worst quality, greyscale, bad anatomy, bad hands, error, text" --cfg-scale 5.0 --sampling-method euler -H 1024 -W 1024 --pm-style-strength 10 --vae-on-cpu --steps 50
|
||||||
```
|
```
|
||||||
|
|
||||||
## PhotoMaker Version 2
|
## PhotoMaker Version 2
|
||||||
|
|||||||
@ -23,5 +23,5 @@ You can also convert weights in the formats `ckpt/safetensors/diffusers` to gguf
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./bin/sd -M convert -m ../models/v1-5-pruned-emaonly.safetensors -o ../models/v1-5-pruned-emaonly.q8_0.gguf -v --type q8_0
|
./bin/sd-cli -M convert -m ../models/v1-5-pruned-emaonly.safetensors -o ../models/v1-5-pruned-emaonly.q8_0.gguf -v --type q8_0
|
||||||
```
|
```
|
||||||
@ -14,7 +14,7 @@
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\qwen-image-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\qwen_image_vae.safetensors --llm ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct-Q8_0.gguf -p '一个穿着"QWEN"标志的T恤的中国美女正拿着黑色的马克笔面相镜头微笑。她身后的玻璃板上手写体写着 “一、Qwen-Image的技术路线: 探索视觉生成基础模型的极限,开创理解与生成一体化的未来。二、Qwen-Image的模型特色:1、复杂文字渲染。支持中英渲染、自动布局; 2、精准图像编辑。支持文字编辑、物体增减、风格变换。三、Qwen-Image的未来愿景:赋能专业内容创作、助力生成式AI发展。”' --cfg-scale 2.5 --sampling-method euler -v --offload-to-cpu -H 1024 -W 1024 --diffusion-fa --flow-shift 3
|
.\bin\Release\sd-cli.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\qwen-image-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\qwen_image_vae.safetensors --llm ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct-Q8_0.gguf -p '一个穿着"QWEN"标志的T恤的中国美女正拿着黑色的马克笔面相镜头微笑。她身后的玻璃板上手写体写着 “一、Qwen-Image的技术路线: 探索视觉生成基础模型的极限,开创理解与生成一体化的未来。二、Qwen-Image的模型特色:1、复杂文字渲染。支持中英渲染、自动布局; 2、精准图像编辑。支持文字编辑、物体增减、风格变换。三、Qwen-Image的未来愿景:赋能专业内容创作、助力生成式AI发展。”' --cfg-scale 2.5 --sampling-method euler -v --offload-to-cpu -H 1024 -W 1024 --diffusion-fa --flow-shift 3
|
||||||
```
|
```
|
||||||
|
|
||||||
<img alt="qwen example" src="../assets/qwen/example.png" />
|
<img alt="qwen example" src="../assets/qwen/example.png" />
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
### Qwen Image Edit
|
### Qwen Image Edit
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\Qwen_Image_Edit-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\qwen_image_vae.safetensors --llm ..\..\ComfyUI\models\text_encoders\qwen_2.5_vl_7b.safetensors --cfg-scale 2.5 --sampling-method euler -v --offload-to-cpu --diffusion-fa --flow-shift 3 -r ..\assets\flux\flux1-dev-q8_0.png -p "change 'flux.cpp' to 'edit.cpp'" --seed 1118877715456453
|
.\bin\Release\sd-cli.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\Qwen_Image_Edit-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\qwen_image_vae.safetensors --llm ..\..\ComfyUI\models\text_encoders\qwen_2.5_vl_7b.safetensors --cfg-scale 2.5 --sampling-method euler -v --offload-to-cpu --diffusion-fa --flow-shift 3 -r ..\assets\flux\flux1-dev-q8_0.png -p "change 'flux.cpp' to 'edit.cpp'" --seed 1118877715456453
|
||||||
```
|
```
|
||||||
|
|
||||||
<img alt="qwen_image_edit" src="../assets/qwen/qwen_image_edit.png" />
|
<img alt="qwen_image_edit" src="../assets/qwen/qwen_image_edit.png" />
|
||||||
@ -29,7 +29,7 @@
|
|||||||
### Qwen Image Edit 2509
|
### Qwen Image Edit 2509
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\Qwen-Image-Edit-2509-Q4_K_S.gguf --vae ..\..\ComfyUI\models\vae\qwen_image_vae.safetensors --llm ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct-Q8_0.gguf --llm_vision ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct.mmproj-Q8_0.gguf --cfg-scale 2.5 --sampling-method euler -v --offload-to-cpu --diffusion-fa --flow-shift 3 -r ..\assets\flux\flux1-dev-q8_0.png -p "change 'flux.cpp' to 'Qwen Image Edit 2509'"
|
.\bin\Release\sd-cli.exe --diffusion-model ..\..\ComfyUI\models\diffusion_models\Qwen-Image-Edit-2509-Q4_K_S.gguf --vae ..\..\ComfyUI\models\vae\qwen_image_vae.safetensors --llm ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct-Q8_0.gguf --llm_vision ..\..\ComfyUI\models\text_encoders\Qwen2.5-VL-7B-Instruct.mmproj-Q8_0.gguf --cfg-scale 2.5 --sampling-method euler -v --offload-to-cpu --diffusion-fa --flow-shift 3 -r ..\assets\flux\flux1-dev-q8_0.png -p "change 'flux.cpp' to 'Qwen Image Edit 2509'"
|
||||||
```
|
```
|
||||||
|
|
||||||
<img alt="qwen_image_edit_2509" src="../assets/qwen/qwen_image_edit_2509.png" />
|
<img alt="qwen_image_edit_2509" src="../assets/qwen/qwen_image_edit_2509.png" />
|
||||||
14
docs/sd.md
14
docs/sd.md
@ -9,12 +9,12 @@
|
|||||||
### txt2img example
|
### txt2img example
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./bin/sd -m ../models/sd-v1-4.ckpt -p "a lovely cat"
|
./bin/sd-cli -m ../models/sd-v1-4.ckpt -p "a lovely cat"
|
||||||
# ./bin/sd -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat"
|
# ./bin/sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat"
|
||||||
# ./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
|
# ./bin/sd-cli -m ../models/sd_xl_base_1.0.safetensors --vae ../models/sdxl_vae-fp16-fix.safetensors -H 1024 -W 1024 -p "a lovely cat" -v
|
||||||
# ./bin/sd -m ../models/sd3_medium_incl_clips_t5xxlfp16.safetensors -H 1024 -W 1024 -p 'a lovely cat holding a sign says \"Stable Diffusion CPP\"' --cfg-scale 4.5 --sampling-method euler -v --clip-on-cpu
|
# ./bin/sd-cli -m ../models/sd3_medium_incl_clips_t5xxlfp16.safetensors -H 1024 -W 1024 -p 'a lovely cat holding a sign says \"Stable Diffusion CPP\"' --cfg-scale 4.5 --sampling-method euler -v --clip-on-cpu
|
||||||
# ./bin/sd --diffusion-model ../models/flux1-dev-q3_k.gguf --vae ../models/ae.sft --clip_l ../models/clip_l.safetensors --t5xxl ../models/t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'flux.cpp'" --cfg-scale 1.0 --sampling-method euler -v --clip-on-cpu
|
# ./bin/sd-cli --diffusion-model ../models/flux1-dev-q3_k.gguf --vae ../models/ae.sft --clip_l ../models/clip_l.safetensors --t5xxl ../models/t5xxl_fp16.safetensors -p "a lovely cat holding a sign says 'flux.cpp'" --cfg-scale 1.0 --sampling-method euler -v --clip-on-cpu
|
||||||
# ./bin/sd -m ..\models\sd3.5_large.safetensors --clip_l ..\models\clip_l.safetensors --clip_g ..\models\clip_g.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -H 1024 -W 1024 -p 'a lovely cat holding a sign says \"Stable diffusion 3.5 Large\"' --cfg-scale 4.5 --sampling-method euler -v --clip-on-cpu
|
# ./bin/sd-cli -m ..\models\sd3.5_large.safetensors --clip_l ..\models\clip_l.safetensors --clip_g ..\models\clip_g.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -H 1024 -W 1024 -p 'a lovely cat holding a sign says \"Stable diffusion 3.5 Large\"' --cfg-scale 4.5 --sampling-method euler -v --clip-on-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
Using formats of different precisions will yield results of varying quality.
|
Using formats of different precisions will yield results of varying quality.
|
||||||
@ -29,7 +29,7 @@ Using formats of different precisions will yield results of varying quality.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
./bin/sd -m ../models/sd-v1-4.ckpt -p "cat with blue eyes" -i ./output.png -o ./img2img_output.png --strength 0.4
|
./bin/sd-cli -m ../models/sd-v1-4.ckpt -p "cat with blue eyes" -i ./output.png -o ./img2img_output.png --strength 0.4
|
||||||
```
|
```
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -m ..\models\sd3.5_large.safetensors --clip_l ..\models\clip_l.safetensors --clip_g ..\models\clip_g.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -H 1024 -W 1024 -p 'a lovely cat holding a sign says \"Stable diffusion 3.5 Large\"' --cfg-scale 4.5 --sampling-method euler -v --clip-on-cpu
|
.\bin\Release\sd-cli.exe -m ..\models\sd3.5_large.safetensors --clip_l ..\models\clip_l.safetensors --clip_g ..\models\clip_g.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -H 1024 -W 1024 -p 'a lovely cat holding a sign says \"Stable diffusion 3.5 Large\"' --cfg-scale 4.5 --sampling-method euler -v --clip-on-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@ -13,5 +13,5 @@ curl -L -O https://huggingface.co/madebyollin/taesd/resolve/main/diffusion_pytor
|
|||||||
- Specify the model path using the `--taesd PATH` parameter. example:
|
- Specify the model path using the `--taesd PATH` parameter. example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sd -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat" --taesd ../models/diffusion_pytorch_model.safetensors
|
sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat" --taesd ../models/diffusion_pytorch_model.safetensors
|
||||||
```
|
```
|
||||||
34
docs/wan.md
34
docs/wan.md
@ -52,7 +52,7 @@
|
|||||||
### Wan2.1 T2V 1.3B
|
### Wan2.1 T2V 1.3B
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1_t2v_1.3B_fp16.safetensors --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --video-frames 33 --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1_t2v_1.3B_fp16.safetensors --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --video-frames 33 --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_1.3B_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_1.3B_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
### Wan2.1 T2V 14B
|
### Wan2.1 T2V 14B
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-t2v-14b-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --video-frames 33 --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-t2v-14b-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --video-frames 33 --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_14B_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_14B_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -70,7 +70,7 @@
|
|||||||
### Wan2.1 I2V 14B
|
### Wan2.1 I2V 14B
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-i2v-14b-480p-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf --clip_vision ..\..\ComfyUI\models\clip_vision\clip_vision_h.safetensors -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --video-frames 33 --offload-to-cpu -i ..\assets\cat_with_sd_cpp_42.png --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-i2v-14b-480p-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf --clip_vision ..\..\ComfyUI\models\clip_vision\clip_vision_h.safetensors -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --video-frames 33 --offload-to-cpu -i ..\assets\cat_with_sd_cpp_42.png --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_14B_i2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_14B_i2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -78,7 +78,7 @@
|
|||||||
### Wan2.2 T2V A14B
|
### Wan2.2 T2V A14B
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 3.5 --sampling-method euler --steps 10 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 8 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --video-frames 33 --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 3.5 --sampling-method euler --steps 10 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 8 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --video-frames 33 --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.2_14B_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.2_14B_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -86,7 +86,7 @@
|
|||||||
### Wan2.2 I2V A14B
|
### Wan2.2 I2V A14B
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-I2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-I2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 3.5 --sampling-method euler --steps 10 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 8 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --video-frames 33 --offload-to-cpu -i ..\assets\cat_with_sd_cpp_42.png --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-I2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-I2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 3.5 --sampling-method euler --steps 10 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 8 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --video-frames 33 --offload-to-cpu -i ..\assets\cat_with_sd_cpp_42.png --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.2_14B_i2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.2_14B_i2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -94,7 +94,7 @@
|
|||||||
### Wan2.2 T2V A14B T2I
|
### Wan2.2 T2V A14B T2I
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 3.5 --sampling-method euler --steps 10 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 8 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 3.5 --sampling-method euler --steps 10 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 8 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<img width="832" height="480" alt="Wan2 2_14B_t2i" src="../assets/wan/Wan2.2_14B_t2i.png" />
|
<img width="832" height="480" alt="Wan2 2_14B_t2i" src="../assets/wan/Wan2.2_14B_t2i.png" />
|
||||||
@ -102,7 +102,7 @@
|
|||||||
### Wan2.2 T2V 14B with Lora
|
### Wan2.2 T2V 14B with Lora
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat<lora:wan2.2_t2v_lightx2v_4steps_lora_v1.1_low_noise:1><lora:|high_noise|wan2.2_t2v_lightx2v_4steps_lora_v1.1_high_noise:1>" --cfg-scale 3.5 --sampling-method euler --steps 4 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 4 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --lora-model-dir ..\..\ComfyUI\models\loras --video-frames 33 --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-T2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat<lora:wan2.2_t2v_lightx2v_4steps_lora_v1.1_low_noise:1><lora:|high_noise|wan2.2_t2v_lightx2v_4steps_lora_v1.1_high_noise:1>" --cfg-scale 3.5 --sampling-method euler --steps 4 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 4 -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --offload-to-cpu --lora-model-dir ..\..\ComfyUI\models\loras --video-frames 33 --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.2_14B_t2v_lora.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.2_14B_t2v_lora.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -114,7 +114,7 @@
|
|||||||
#### T2V
|
#### T2V
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.2_ti2v_5B_fp16.safetensors --vae ..\..\ComfyUI\models\vae\wan2.2_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --offload-to-cpu --video-frames 33 --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.2_ti2v_5B_fp16.safetensors --vae ..\..\ComfyUI\models\vae\wan2.2_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --offload-to-cpu --video-frames 33 --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.2_5B_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.2_5B_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -122,7 +122,7 @@
|
|||||||
#### I2V
|
#### I2V
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.2_ti2v_5B_fp16.safetensors --vae ..\..\ComfyUI\models\vae\wan2.2_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --offload-to-cpu --video-frames 33 -i ..\assets\cat_with_sd_cpp_42.png --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.2_ti2v_5B_fp16.safetensors --vae ..\..\ComfyUI\models\vae\wan2.2_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --offload-to-cpu --video-frames 33 -i ..\assets\cat_with_sd_cpp_42.png --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.2_5B_i2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.2_5B_i2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -130,7 +130,7 @@
|
|||||||
### Wan2.1 FLF2V 14B
|
### Wan2.1 FLF2V 14B
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-flf2v-14b-720p-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf --clip_vision ..\..\ComfyUI\models\clip_vision\clip_vision_h.safetensors -p "glass flower blossom" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --video-frames 33 --offload-to-cpu --init-img ..\..\ComfyUI\input\start_image.png --end-img ..\..\ComfyUI\input\end_image.png --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-flf2v-14b-720p-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf --clip_vision ..\..\ComfyUI\models\clip_vision\clip_vision_h.safetensors -p "glass flower blossom" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --video-frames 33 --offload-to-cpu --init-img ..\..\ComfyUI\input\start_image.png --end-img ..\..\ComfyUI\input\end_image.png --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -139,7 +139,7 @@
|
|||||||
### Wan2.2 FLF2V 14B
|
### Wan2.2 FLF2V 14B
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-I2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-I2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf --cfg-scale 3.5 --sampling-method euler --steps 10 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 8 -v -p "glass flower blossom" -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --video-frames 33 --offload-to-cpu --init-img ..\..\ComfyUI\input\start_image.png --end-img ..\..\ComfyUI\input\end_image.png --flow-shift 3.0
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-I2V-A14B-LowNoise-Q8_0.gguf --high-noise-diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.2-I2V-A14B-HighNoise-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf --cfg-scale 3.5 --sampling-method euler --steps 10 --high-noise-cfg-scale 3.5 --high-noise-sampling-method euler --high-noise-steps 8 -v -p "glass flower blossom" -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa --video-frames 33 --offload-to-cpu --init-img ..\..\ComfyUI\input\start_image.png --end-img ..\..\ComfyUI\input\end_image.png --flow-shift 3.0
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.2_14B_flf2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.2_14B_flf2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -149,7 +149,7 @@
|
|||||||
#### T2V
|
#### T2V
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-vace-1.3b-q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --video-frames 1 --offload-to-cpu
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-vace-1.3b-q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --video-frames 1 --offload-to-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_1.3B_vace_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_1.3B_vace_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -158,7 +158,7 @@
|
|||||||
#### R2V
|
#### R2V
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-vace-1.3b-q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa -i ..\assets\cat_with_sd_cpp_42.png --video-frames 33 --offload-to-cpu
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-vace-1.3b-q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa -i ..\assets\cat_with_sd_cpp_42.png --video-frames 33 --offload-to-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_1.3B_vace_r2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_1.3B_vace_r2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -169,7 +169,7 @@
|
|||||||
```
|
```
|
||||||
mkdir post+depth
|
mkdir post+depth
|
||||||
ffmpeg -i ..\..\ComfyUI\input\post+depth.mp4 -qscale:v 1 -vf fps=8 post+depth\frame_%04d.jpg
|
ffmpeg -i ..\..\ComfyUI\input\post+depth.mp4 -qscale:v 1 -vf fps=8 post+depth\frame_%04d.jpg
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-vace-1.3b-q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "The girl is dancing in a sea of flowers, slowly moving her hands. There is a close - up shot of her upper body. The character is surrounded by other transparent glass flowers in the style of Nicoletta Ceccoli, creating a beautiful, surreal, and emotionally expressive movie scene with a white. transparent feel and a dreamyl atmosphere." --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa -i ..\..\ComfyUI\input\dance_girl.jpg --control-video ./post+depth --video-frames 33 --offload-to-cpu
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\wan2.1-vace-1.3b-q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "The girl is dancing in a sea of flowers, slowly moving her hands. There is a close - up shot of her upper body. The character is surrounded by other transparent glass flowers in the style of Nicoletta Ceccoli, creating a beautiful, surreal, and emotionally expressive movie scene with a white. transparent feel and a dreamyl atmosphere." --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa -i ..\..\ComfyUI\input\dance_girl.jpg --control-video ./post+depth --video-frames 33 --offload-to-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_1.3B_vace_v2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_1.3B_vace_v2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -179,7 +179,7 @@ ffmpeg -i ..\..\ComfyUI\input\post+depth.mp4 -qscale:v 1 -vf fps=8 post+depth\fr
|
|||||||
#### T2V
|
#### T2V
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.1_14B_VACE-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --video-frames 33 --offload-to-cpu
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.1_14B_VACE-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa --video-frames 33 --offload-to-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_14B_vace_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_14B_vace_t2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -188,7 +188,7 @@ ffmpeg -i ..\..\ComfyUI\input\post+depth.mp4 -qscale:v 1 -vf fps=8 post+depth\fr
|
|||||||
#### R2V
|
#### R2V
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.1_14B_VACE-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa -i ..\assets\cat_with_sd_cpp_42.png --video-frames 33 --offload-to-cpu
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.1_14B_VACE-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 832 -H 480 --diffusion-fa -i ..\assets\cat_with_sd_cpp_42.png --video-frames 33 --offload-to-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_14B_vace_r2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_14B_vace_r2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
@ -198,7 +198,7 @@ ffmpeg -i ..\..\ComfyUI\input\post+depth.mp4 -qscale:v 1 -vf fps=8 post+depth\fr
|
|||||||
#### V2V
|
#### V2V
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.1_14B_VACE-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "The girl is dancing in a sea of flowers, slowly moving her hands. There is a close - up shot of her upper body. The character is surrounded by other transparent glass flowers in the style of Nicoletta Ceccoli, creating a beautiful, surreal, and emotionally expressive movie scene with a white. transparent feel and a dreamyl atmosphere." --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa -i ..\..\ComfyUI\input\dance_girl.jpg --control-video ./post+depth --video-frames 33 --offload-to-cpu
|
.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\..\ComfyUI\models\diffusion_models\Wan2.1_14B_VACE-Q8_0.gguf --vae ..\..\ComfyUI\models\vae\wan_2.1_vae.safetensors --t5xxl ..\..\ComfyUI\models\text_encoders\umt5-xxl-encoder-Q8_0.gguf -p "The girl is dancing in a sea of flowers, slowly moving her hands. There is a close - up shot of her upper body. The character is surrounded by other transparent glass flowers in the style of Nicoletta Ceccoli, creating a beautiful, surreal, and emotionally expressive movie scene with a white. transparent feel and a dreamyl atmosphere." --cfg-scale 6.0 --sampling-method euler -v -n "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部, 畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走" -W 480 -H 832 --diffusion-fa -i ..\..\ComfyUI\input\dance_girl.jpg --control-video ./post+depth --video-frames 33 --offload-to-cpu
|
||||||
```
|
```
|
||||||
|
|
||||||
<video src=../assets/wan/Wan2.1_14B_vace_v2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
<video src=../assets/wan/Wan2.1_14B_vace_v2v.mp4 controls="controls" muted="muted" type="video/mp4"></video>
|
||||||
|
|||||||
@ -16,7 +16,7 @@ You can run Z-Image with stable-diffusion.cpp on GPUs with 4GB of VRAM — or ev
|
|||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
.\bin\Release\sd.exe --diffusion-model z_image_turbo-Q3_K.gguf --vae ..\..\ComfyUI\models\vae\ae.sft --llm ..\..\ComfyUI\models\text_encoders\Qwen3-4B-Instruct-2507-Q4_K_M.gguf -p "A cinematic, melancholic photograph of a solitary hooded figure walking through a sprawling, rain-slicked metropolis at night. The city lights are a chaotic blur of neon orange and cool blue, reflecting on the wet asphalt. The scene evokes a sense of being a single component in a vast machine. Superimposed over the image in a sleek, modern, slightly glitched font is the philosophical quote: 'THE CITY IS A CIRCUIT BOARD, AND I AM A BROKEN TRANSISTOR.' -- moody, atmospheric, profound, dark academic" --cfg-scale 1.0 -v --offload-to-cpu --diffusion-fa -H 1024 -W 512
|
.\bin\Release\sd-cli.exe --diffusion-model z_image_turbo-Q3_K.gguf --vae ..\..\ComfyUI\models\vae\ae.sft --llm ..\..\ComfyUI\models\text_encoders\Qwen3-4B-Instruct-2507-Q4_K_M.gguf -p "A cinematic, melancholic photograph of a solitary hooded figure walking through a sprawling, rain-slicked metropolis at night. The city lights are a chaotic blur of neon orange and cool blue, reflecting on the wet asphalt. The scene evokes a sense of being a single component in a vast machine. Superimposed over the image in a sleek, modern, slightly glitched font is the philosophical quote: 'THE CITY IS A CIRCUIT BOARD, AND I AM A BROKEN TRANSISTOR.' -- moody, atmospheric, profound, dark academic" --cfg-scale 1.0 -v --offload-to-cpu --diffusion-fa -H 1024 -W 512
|
||||||
```
|
```
|
||||||
|
|
||||||
<img width="256" alt="z-image example" src="../assets/z_image/q3_K.png" />
|
<img width="256" alt="z-image example" src="../assets/z_image/q3_K.png" />
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
add_subdirectory(cli)
|
add_subdirectory(cli)
|
||||||
|
add_subdirectory(server)
|
||||||
@ -1,4 +1,4 @@
|
|||||||
set(TARGET sd)
|
set(TARGET sd-cli)
|
||||||
|
|
||||||
add_executable(${TARGET} main.cpp)
|
add_executable(${TARGET} main.cpp)
|
||||||
install(TARGETS ${TARGET} RUNTIME)
|
install(TARGETS ${TARGET} RUNTIME)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Run
|
# Run
|
||||||
|
|
||||||
```
|
```
|
||||||
usage: ./bin/sd [options]
|
usage: ./bin/sd-cli [options]
|
||||||
|
|
||||||
CLI Options:
|
CLI Options:
|
||||||
-o, --output <string> path to write result image to (default: ./output.png)
|
-o, --output <string> path to write result image to (default: ./output.png)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
1752
examples/common/common.hpp
Normal file
1752
examples/common/common.hpp
Normal file
File diff suppressed because it is too large
Load Diff
6
examples/server/CMakeLists.txt
Normal file
6
examples/server/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
set(TARGET sd-server)
|
||||||
|
|
||||||
|
add_executable(${TARGET} main.cpp)
|
||||||
|
install(TARGETS ${TARGET} RUNTIME)
|
||||||
|
target_link_libraries(${TARGET} PRIVATE stable-diffusion ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
target_compile_features(${TARGET} PUBLIC c_std_11 cxx_std_17)
|
||||||
63
examples/server/README.md
Normal file
63
examples/server/README.md
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# Run
|
||||||
|
|
||||||
|
```
|
||||||
|
usage: ./bin/sd-server [options]
|
||||||
|
|
||||||
|
Svr Options:
|
||||||
|
-l, --listen-ip <string> server listen ip (default: 127.0.0.1)
|
||||||
|
--listen-port <int> server listen port (default: 1234)
|
||||||
|
-v, --verbose print extra info
|
||||||
|
--color colors the logging tags according to level
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
|
||||||
|
Context Options:
|
||||||
|
-m, --model <string> path to full model
|
||||||
|
--clip_l <string> path to the clip-l text encoder
|
||||||
|
--clip_g <string> path to the clip-g text encoder
|
||||||
|
--clip_vision <string> path to the clip-vision encoder
|
||||||
|
--t5xxl <string> path to the t5xxl text encoder
|
||||||
|
--llm <string> path to the llm text encoder. For example: (qwenvl2.5 for qwen-image, mistral-small3.2 for flux2, ...)
|
||||||
|
--llm_vision <string> path to the llm vit
|
||||||
|
--qwen2vl <string> alias of --llm. Deprecated.
|
||||||
|
--qwen2vl_vision <string> alias of --llm_vision. Deprecated.
|
||||||
|
--diffusion-model <string> path to the standalone diffusion model
|
||||||
|
--high-noise-diffusion-model <string> path to the standalone high noise diffusion model
|
||||||
|
--vae <string> path to standalone vae model
|
||||||
|
--taesd <string> path to taesd. Using Tiny AutoEncoder for fast decoding (low quality)
|
||||||
|
--control-net <string> path to control net model
|
||||||
|
--embd-dir <string> embeddings directory
|
||||||
|
--lora-model-dir <string> lora model directory
|
||||||
|
--tensor-type-rules <string> weight type per tensor pattern (example: "^vae\.=f16,model\.=q8_0")
|
||||||
|
--photo-maker <string> path to PHOTOMAKER model
|
||||||
|
--upscale-model <string> path to esrgan model.
|
||||||
|
-t, --threads <int> number of threads to use during computation (default: -1). If threads <= 0, then threads will be set to the number of
|
||||||
|
CPU physical cores
|
||||||
|
--chroma-t5-mask-pad <int> t5 mask pad size of chroma
|
||||||
|
--vae-tile-overlap <float> tile overlap for vae tiling, in fraction of tile size (default: 0.5)
|
||||||
|
--flow-shift <float> shift value for Flow models like SD3.x or WAN (default: auto)
|
||||||
|
--vae-tiling process vae in tiles to reduce memory usage
|
||||||
|
--force-sdxl-vae-conv-scale force use of conv scale on sdxl vae
|
||||||
|
--offload-to-cpu place the weights in RAM to save VRAM, and automatically load them into VRAM when needed
|
||||||
|
--control-net-cpu keep controlnet in cpu (for low vram)
|
||||||
|
--clip-on-cpu keep clip in cpu (for low vram)
|
||||||
|
--vae-on-cpu keep vae in cpu (for low vram)
|
||||||
|
--diffusion-fa use flash attention in the diffusion model
|
||||||
|
--diffusion-conv-direct use ggml_conv2d_direct in the diffusion model
|
||||||
|
--vae-conv-direct use ggml_conv2d_direct in the vae model
|
||||||
|
--chroma-disable-dit-mask disable dit mask for chroma
|
||||||
|
--chroma-enable-t5-mask enable t5 mask for chroma
|
||||||
|
--type weight type (examples: f32, f16, q4_0, q4_1, q5_0, q5_1, q8_0, q2_K, q3_K, q4_K). If not specified, the default is the
|
||||||
|
type of the weight file
|
||||||
|
--rng RNG, one of [std_default, cuda, cpu], default: cuda(sd-webui), cpu(comfyui)
|
||||||
|
--sampler-rng sampler RNG, one of [std_default, cuda, cpu]. If not specified, use --rng
|
||||||
|
--prediction prediction type override, one of [eps, v, edm_v, sd3_flow, flux_flow, flux2_flow]
|
||||||
|
--lora-apply-mode the way to apply LoRA, one of [auto, immediately, at_runtime], default is auto. In auto mode, if the model weights
|
||||||
|
contain any quantized parameters, the at_runtime mode will be used; otherwise,
|
||||||
|
immediately will be used.The immediately mode may have precision and
|
||||||
|
compatibility issues with quantized parameters, but it usually offers faster inference
|
||||||
|
speed and, in some cases, lower memory usage. The at_runtime mode, on the
|
||||||
|
other hand, is exactly the opposite.
|
||||||
|
--vae-tile-size tile size for vae tiling, format [X]x[Y] (default: 32x32)
|
||||||
|
--vae-relative-tile-size relative tile size for vae tiling, format [X]x[Y], in fraction of image size if < 1, in number of tiles per dim if >=1
|
||||||
|
(overrides --vae-tile-size)
|
||||||
|
```
|
||||||
715
examples/server/main.cpp
Normal file
715
examples/server/main.cpp
Normal file
@ -0,0 +1,715 @@
|
|||||||
|
// main.cpp
|
||||||
|
#include <chrono>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <iostream>
|
||||||
|
#include <mutex>
|
||||||
|
#include <sstream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "httplib.h"
|
||||||
|
#include "stable-diffusion.h"
|
||||||
|
|
||||||
|
#include "common/common.hpp"
|
||||||
|
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
// ----------------------- helpers -----------------------
|
||||||
|
static const std::string base64_chars =
|
||||||
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
|
"abcdefghijklmnopqrstuvwxyz"
|
||||||
|
"0123456789+/";
|
||||||
|
|
||||||
|
std::string base64_encode(const std::vector<uint8_t>& bytes) {
|
||||||
|
std::string ret;
|
||||||
|
int val = 0, valb = -6;
|
||||||
|
for (uint8_t c : bytes) {
|
||||||
|
val = (val << 8) + c;
|
||||||
|
valb += 8;
|
||||||
|
while (valb >= 0) {
|
||||||
|
ret.push_back(base64_chars[(val >> valb) & 0x3F]);
|
||||||
|
valb -= 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (valb > -6)
|
||||||
|
ret.push_back(base64_chars[((val << 8) >> (valb + 8)) & 0x3F]);
|
||||||
|
while (ret.size() % 4)
|
||||||
|
ret.push_back('=');
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool is_base64(unsigned char c) {
|
||||||
|
return (isalnum(c) || (c == '+') || (c == '/'));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<uint8_t> base64_decode(const std::string& encoded_string) {
|
||||||
|
int in_len = encoded_string.size();
|
||||||
|
int i = 0;
|
||||||
|
int j = 0;
|
||||||
|
int in_ = 0;
|
||||||
|
uint8_t char_array_4[4], char_array_3[3];
|
||||||
|
std::vector<uint8_t> ret;
|
||||||
|
|
||||||
|
while (in_len-- && (encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
|
||||||
|
char_array_4[i++] = encoded_string[in_];
|
||||||
|
in_++;
|
||||||
|
if (i == 4) {
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
char_array_4[i] = static_cast<uint8_t>(base64_chars.find(char_array_4[i]));
|
||||||
|
|
||||||
|
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
||||||
|
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
||||||
|
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++)
|
||||||
|
ret.push_back(char_array_3[i]);
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i) {
|
||||||
|
for (j = i; j < 4; j++)
|
||||||
|
char_array_4[j] = 0;
|
||||||
|
|
||||||
|
for (j = 0; j < 4; j++)
|
||||||
|
char_array_4[j] = static_cast<uint8_t>(base64_chars.find(char_array_4[j]));
|
||||||
|
|
||||||
|
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
||||||
|
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
||||||
|
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
|
||||||
|
|
||||||
|
for (j = 0; j < i - 1; j++)
|
||||||
|
ret.push_back(char_array_3[j]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string iso_timestamp_now() {
|
||||||
|
using namespace std::chrono;
|
||||||
|
auto now = system_clock::now();
|
||||||
|
std::time_t t = system_clock::to_time_t(now);
|
||||||
|
std::tm tm{};
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
gmtime_s(&tm, &t);
|
||||||
|
#else
|
||||||
|
gmtime_r(&t, &tm);
|
||||||
|
#endif
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << std::put_time(&tm, "%Y-%m-%dT%H:%M:%SZ");
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDSvrParams {
|
||||||
|
std::string listen_ip = "127.0.0.1";
|
||||||
|
int listen_port = 1234;
|
||||||
|
bool normal_exit = false;
|
||||||
|
bool verbose = false;
|
||||||
|
bool color = false;
|
||||||
|
|
||||||
|
ArgOptions get_options() {
|
||||||
|
ArgOptions options;
|
||||||
|
|
||||||
|
options.string_options = {
|
||||||
|
{"-l",
|
||||||
|
"--listen-ip",
|
||||||
|
"server listen ip (default: 127.0.0.1)",
|
||||||
|
&listen_ip}};
|
||||||
|
|
||||||
|
options.int_options = {
|
||||||
|
{"",
|
||||||
|
"--listen-port",
|
||||||
|
"server listen port (default: 1234)",
|
||||||
|
&listen_port},
|
||||||
|
};
|
||||||
|
|
||||||
|
options.bool_options = {
|
||||||
|
{"-v",
|
||||||
|
"--verbose",
|
||||||
|
"print extra info",
|
||||||
|
true, &verbose},
|
||||||
|
{"",
|
||||||
|
"--color",
|
||||||
|
"colors the logging tags according to level",
|
||||||
|
true, &color},
|
||||||
|
};
|
||||||
|
|
||||||
|
auto on_help_arg = [&](int argc, const char** argv, int index) {
|
||||||
|
normal_exit = true;
|
||||||
|
return -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
options.manual_options = {
|
||||||
|
{"-h",
|
||||||
|
"--help",
|
||||||
|
"show this help message and exit",
|
||||||
|
on_help_arg},
|
||||||
|
};
|
||||||
|
return options;
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_and_check() {
|
||||||
|
if (listen_ip.empty()) {
|
||||||
|
fprintf(stderr, "error: the following arguments are required: listen_ip\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listen_port < 0 || listen_port > 65535) {
|
||||||
|
fprintf(stderr, "error: listen_port should be in the range [0, 65535]\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string to_string() const {
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << "SDSvrParams {\n"
|
||||||
|
<< " listen_ip: " << listen_ip << ",\n"
|
||||||
|
<< " listen_port: \"" << listen_port << "\",\n"
|
||||||
|
<< "}";
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void print_usage(int argc, const char* argv[], const std::vector<ArgOptions>& options_list) {
|
||||||
|
std::cout << version_string() << "\n";
|
||||||
|
std::cout << "Usage: " << argv[0] << " [options]\n\n";
|
||||||
|
std::cout << "Svr Options:\n";
|
||||||
|
options_list[0].print();
|
||||||
|
std::cout << "\nContext Options:\n";
|
||||||
|
options_list[1].print();
|
||||||
|
}
|
||||||
|
|
||||||
|
void parse_args(int argc, const char** argv, SDSvrParams& svr_params, SDContextParams& ctx_params) {
|
||||||
|
std::vector<ArgOptions> options_vec = {svr_params.get_options(), ctx_params.get_options()};
|
||||||
|
|
||||||
|
if (!parse_options(argc, argv, options_vec)) {
|
||||||
|
print_usage(argc, argv, options_vec);
|
||||||
|
exit(svr_params.normal_exit ? 0 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!svr_params.process_and_check() || !ctx_params.process_and_check(IMG_GEN)) {
|
||||||
|
print_usage(argc, argv, options_vec);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string extract_and_remove_sd_cpp_extra_args(std::string& text) {
|
||||||
|
std::regex re("<sd_cpp_extra_args>(.*?)</sd_cpp_extra_args>");
|
||||||
|
std::smatch match;
|
||||||
|
|
||||||
|
std::string extracted;
|
||||||
|
if (std::regex_search(text, match, re)) {
|
||||||
|
extracted = match[1].str();
|
||||||
|
text = std::regex_replace(text, re, "");
|
||||||
|
}
|
||||||
|
return extracted;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class ImageFormat { JPEG,
|
||||||
|
PNG };
|
||||||
|
|
||||||
|
std::vector<uint8_t> write_image_to_vector(
|
||||||
|
ImageFormat format,
|
||||||
|
const uint8_t* image,
|
||||||
|
int width,
|
||||||
|
int height,
|
||||||
|
int channels,
|
||||||
|
int quality = 90) {
|
||||||
|
std::vector<uint8_t> buffer;
|
||||||
|
|
||||||
|
auto write_func = [&buffer](void* context, void* data, int size) {
|
||||||
|
uint8_t* src = reinterpret_cast<uint8_t*>(data);
|
||||||
|
buffer.insert(buffer.end(), src, src + size);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ContextWrapper {
|
||||||
|
decltype(write_func)& func;
|
||||||
|
} ctx{write_func};
|
||||||
|
|
||||||
|
auto c_func = [](void* context, void* data, int size) {
|
||||||
|
auto* wrapper = reinterpret_cast<ContextWrapper*>(context);
|
||||||
|
wrapper->func(context, data, size);
|
||||||
|
};
|
||||||
|
|
||||||
|
int result = 0;
|
||||||
|
switch (format) {
|
||||||
|
case ImageFormat::JPEG:
|
||||||
|
result = stbi_write_jpg_to_func(c_func, &ctx, width, height, channels, image, quality);
|
||||||
|
break;
|
||||||
|
case ImageFormat::PNG:
|
||||||
|
result = stbi_write_png_to_func(c_func, &ctx, width, height, channels, image, width * channels);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw std::runtime_error("invalid image format");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
throw std::runtime_error("write imgage to mem failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Enables Printing the log level tag in color using ANSI escape codes */
|
||||||
|
void sd_log_cb(enum sd_log_level_t level, const char* log, void* data) {
|
||||||
|
SDSvrParams* svr_params = (SDSvrParams*)data;
|
||||||
|
int tag_color;
|
||||||
|
const char* level_str;
|
||||||
|
FILE* out_stream = (level == SD_LOG_ERROR) ? stderr : stdout;
|
||||||
|
|
||||||
|
if (!log || (!svr_params->verbose && level <= SD_LOG_DEBUG)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (level) {
|
||||||
|
case SD_LOG_DEBUG:
|
||||||
|
tag_color = 37;
|
||||||
|
level_str = "DEBUG";
|
||||||
|
break;
|
||||||
|
case SD_LOG_INFO:
|
||||||
|
tag_color = 34;
|
||||||
|
level_str = "INFO";
|
||||||
|
break;
|
||||||
|
case SD_LOG_WARN:
|
||||||
|
tag_color = 35;
|
||||||
|
level_str = "WARN";
|
||||||
|
break;
|
||||||
|
case SD_LOG_ERROR:
|
||||||
|
tag_color = 31;
|
||||||
|
level_str = "ERROR";
|
||||||
|
break;
|
||||||
|
default: /* Potential future-proofing */
|
||||||
|
tag_color = 33;
|
||||||
|
level_str = "?????";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (svr_params->color == true) {
|
||||||
|
fprintf(out_stream, "\033[%d;1m[%-5s]\033[0m ", tag_color, level_str);
|
||||||
|
} else {
|
||||||
|
fprintf(out_stream, "[%-5s] ", level_str);
|
||||||
|
}
|
||||||
|
fputs(log, out_stream);
|
||||||
|
fflush(out_stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, const char** argv) {
|
||||||
|
SDSvrParams svr_params;
|
||||||
|
SDContextParams ctx_params;
|
||||||
|
parse_args(argc, argv, svr_params, ctx_params);
|
||||||
|
|
||||||
|
sd_set_log_callback(sd_log_cb, (void*)&svr_params);
|
||||||
|
|
||||||
|
if (svr_params.verbose) {
|
||||||
|
printf("%s", sd_get_system_info());
|
||||||
|
printf("%s\n", svr_params.to_string().c_str());
|
||||||
|
printf("%s\n", ctx_params.to_string().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
sd_ctx_params_t sd_ctx_params = ctx_params.to_sd_ctx_params_t(false, false, false);
|
||||||
|
sd_ctx_t* sd_ctx = new_sd_ctx(&sd_ctx_params);
|
||||||
|
|
||||||
|
if (sd_ctx == nullptr) {
|
||||||
|
printf("new_sd_ctx_t failed\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::mutex sd_ctx_mutex;
|
||||||
|
|
||||||
|
httplib::Server svr;
|
||||||
|
|
||||||
|
// health
|
||||||
|
svr.Get("/", [&](const httplib::Request&, httplib::Response& res) {
|
||||||
|
res.set_content(R"({"ok":true,"service":"sd-cpp-http"})", "application/json");
|
||||||
|
});
|
||||||
|
|
||||||
|
// models endpoint (minimal)
|
||||||
|
svr.Get("/v1/models", [&](const httplib::Request&, httplib::Response& res) {
|
||||||
|
json r;
|
||||||
|
r["data"] = json::array();
|
||||||
|
r["data"].push_back({{"id", "sd-cpp-local"}, {"object", "model"}, {"owned_by", "local"}});
|
||||||
|
res.set_content(r.dump(), "application/json");
|
||||||
|
});
|
||||||
|
|
||||||
|
// core endpoint: /v1/images/generations
|
||||||
|
svr.Post("/v1/images/generations", [&](const httplib::Request& req, httplib::Response& res) {
|
||||||
|
try {
|
||||||
|
if (req.body.empty()) {
|
||||||
|
res.status = 400;
|
||||||
|
res.set_content(R"({"error":"empty body"})", "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
json j = json::parse(req.body);
|
||||||
|
std::string prompt = j.value("prompt", "");
|
||||||
|
int n = std::max(1, j.value("n", 1));
|
||||||
|
std::string size = j.value("size", "");
|
||||||
|
std::string output_format = j.value("output_format", "png");
|
||||||
|
int output_compression = j.value("output_compression", 100);
|
||||||
|
int width = 512;
|
||||||
|
int height = 512;
|
||||||
|
if (!size.empty()) {
|
||||||
|
auto pos = size.find('x');
|
||||||
|
if (pos != std::string::npos) {
|
||||||
|
try {
|
||||||
|
width = std::stoi(size.substr(0, pos));
|
||||||
|
height = std::stoi(size.substr(pos + 1));
|
||||||
|
} catch (...) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prompt.empty()) {
|
||||||
|
res.status = 400;
|
||||||
|
res.set_content(R"({"error":"prompt required"})", "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string sd_cpp_extra_args_str = extract_and_remove_sd_cpp_extra_args(prompt);
|
||||||
|
|
||||||
|
if (output_format != "png" && output_format != "jpeg") {
|
||||||
|
res.status = 400;
|
||||||
|
res.set_content(R"({"error":"invalid output_format, must be one of [png, jpeg]"})", "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (n <= 0)
|
||||||
|
n = 1;
|
||||||
|
if (n > 8)
|
||||||
|
n = 8; // safety
|
||||||
|
if (output_compression > 100) {
|
||||||
|
output_compression = 100;
|
||||||
|
}
|
||||||
|
if (output_compression < 0) {
|
||||||
|
output_compression = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
json out;
|
||||||
|
out["created"] = iso_timestamp_now();
|
||||||
|
out["data"] = json::array();
|
||||||
|
out["output_format"] = output_format;
|
||||||
|
|
||||||
|
SDGenerationParams gen_params;
|
||||||
|
gen_params.prompt = prompt;
|
||||||
|
gen_params.width = width;
|
||||||
|
gen_params.height = height;
|
||||||
|
gen_params.batch_count = n;
|
||||||
|
|
||||||
|
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");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) {
|
||||||
|
res.status = 400;
|
||||||
|
res.set_content(R"({"error":"invalid params"})", "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (svr_params.verbose) {
|
||||||
|
printf("%s\n", gen_params.to_string().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
sd_image_t init_image = {(uint32_t)gen_params.width, (uint32_t)gen_params.height, 3, nullptr};
|
||||||
|
sd_image_t control_image = {(uint32_t)gen_params.width, (uint32_t)gen_params.height, 3, nullptr};
|
||||||
|
sd_image_t mask_image = {(uint32_t)gen_params.width, (uint32_t)gen_params.height, 1, nullptr};
|
||||||
|
std::vector<sd_image_t> pmid_images;
|
||||||
|
|
||||||
|
sd_img_gen_params_t img_gen_params = {
|
||||||
|
gen_params.lora_vec.data(),
|
||||||
|
static_cast<uint32_t>(gen_params.lora_vec.size()),
|
||||||
|
gen_params.prompt.c_str(),
|
||||||
|
gen_params.negative_prompt.c_str(),
|
||||||
|
gen_params.clip_skip,
|
||||||
|
init_image,
|
||||||
|
nullptr,
|
||||||
|
0,
|
||||||
|
gen_params.auto_resize_ref_image,
|
||||||
|
gen_params.increase_ref_index,
|
||||||
|
mask_image,
|
||||||
|
gen_params.width,
|
||||||
|
gen_params.height,
|
||||||
|
gen_params.sample_params,
|
||||||
|
gen_params.strength,
|
||||||
|
gen_params.seed,
|
||||||
|
gen_params.batch_count,
|
||||||
|
control_image,
|
||||||
|
gen_params.control_strength,
|
||||||
|
{
|
||||||
|
pmid_images.data(),
|
||||||
|
(int)pmid_images.size(),
|
||||||
|
gen_params.pm_id_embed_path.c_str(),
|
||||||
|
gen_params.pm_style_strength,
|
||||||
|
}, // pm_params
|
||||||
|
ctx_params.vae_tiling_params,
|
||||||
|
gen_params.easycache_params,
|
||||||
|
};
|
||||||
|
|
||||||
|
sd_image_t* results = nullptr;
|
||||||
|
int num_results = 0;
|
||||||
|
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(sd_ctx_mutex);
|
||||||
|
results = generate_image(sd_ctx, &img_gen_params);
|
||||||
|
num_results = gen_params.batch_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < num_results; i++) {
|
||||||
|
if (results[i].data == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto image_bytes = write_image_to_vector(output_format == "jpeg" ? ImageFormat::JPEG : ImageFormat::PNG,
|
||||||
|
results[i].data,
|
||||||
|
results[i].width,
|
||||||
|
results[i].height,
|
||||||
|
results[i].channel,
|
||||||
|
output_compression);
|
||||||
|
if (image_bytes.empty()) {
|
||||||
|
printf("write image to mem failed\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// base64 encode
|
||||||
|
std::string b64 = base64_encode(image_bytes);
|
||||||
|
json item;
|
||||||
|
item["b64_json"] = b64;
|
||||||
|
out["data"].push_back(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
res.set_content(out.dump(), "application/json");
|
||||||
|
res.status = 200;
|
||||||
|
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
res.status = 500;
|
||||||
|
json err;
|
||||||
|
err["error"] = "server_error";
|
||||||
|
err["message"] = e.what();
|
||||||
|
res.set_content(err.dump(), "application/json");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
svr.Post("/v1/images/edits", [&](const httplib::Request& req, httplib::Response& res) {
|
||||||
|
try {
|
||||||
|
if (!req.is_multipart_form_data()) {
|
||||||
|
res.status = 400;
|
||||||
|
res.set_content(R"({"error":"Content-Type must be multipart/form-data"})", "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string prompt = req.form.get_field("prompt");
|
||||||
|
if (prompt.empty()) {
|
||||||
|
res.status = 400;
|
||||||
|
res.set_content(R"({"error":"prompt required"})", "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string sd_cpp_extra_args_str = extract_and_remove_sd_cpp_extra_args(prompt);
|
||||||
|
|
||||||
|
size_t image_count = req.form.get_file_count("image[]");
|
||||||
|
if (image_count == 0) {
|
||||||
|
res.status = 400;
|
||||||
|
res.set_content(R"({"error":"at least one image[] required"})", "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::vector<uint8_t>> images_bytes;
|
||||||
|
for (size_t i = 0; i < image_count; i++) {
|
||||||
|
auto file = req.form.get_file("image[]", i);
|
||||||
|
images_bytes.emplace_back(file.content.begin(), file.content.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<uint8_t> mask_bytes;
|
||||||
|
if (req.form.has_field("mask")) {
|
||||||
|
auto file = req.form.get_file("mask");
|
||||||
|
mask_bytes.assign(file.content.begin(), file.content.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
int n = 1;
|
||||||
|
if (req.form.has_field("n")) {
|
||||||
|
try {
|
||||||
|
n = std::stoi(req.form.get_field("n"));
|
||||||
|
} catch (...) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
n = std::clamp(n, 1, 8);
|
||||||
|
|
||||||
|
std::string size = req.form.get_field("size");
|
||||||
|
int width = 512, height = 512;
|
||||||
|
if (!size.empty()) {
|
||||||
|
auto pos = size.find('x');
|
||||||
|
if (pos != std::string::npos) {
|
||||||
|
try {
|
||||||
|
width = std::stoi(size.substr(0, pos));
|
||||||
|
height = std::stoi(size.substr(pos + 1));
|
||||||
|
} catch (...) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string output_format = "png";
|
||||||
|
if (req.form.has_field("output_format"))
|
||||||
|
output_format = req.form.get_field("output_format");
|
||||||
|
if (output_format != "png" && output_format != "jpeg") {
|
||||||
|
res.status = 400;
|
||||||
|
res.set_content(R"({"error":"invalid output_format, must be one of [png, jpeg]"})", "application/json");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string output_compression_str = req.form.get_field("output_compression");
|
||||||
|
int output_compression = 100;
|
||||||
|
try {
|
||||||
|
output_compression = std::stoi(output_compression_str);
|
||||||
|
} catch (...) {
|
||||||
|
}
|
||||||
|
if (output_compression > 100) {
|
||||||
|
output_compression = 100;
|
||||||
|
}
|
||||||
|
if (output_compression < 0) {
|
||||||
|
output_compression = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDGenerationParams gen_params;
|
||||||
|
gen_params.prompt = prompt;
|
||||||
|
gen_params.width = width;
|
||||||
|
gen_params.height = height;
|
||||||
|
gen_params.batch_count = n;
|
||||||
|
|
||||||
|
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");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (svr_params.verbose) {
|
||||||
|
printf("%s\n", gen_params.to_string().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
sd_image_t init_image = {(uint32_t)gen_params.width, (uint32_t)gen_params.height, 3, nullptr};
|
||||||
|
sd_image_t control_image = {(uint32_t)gen_params.width, (uint32_t)gen_params.height, 3, nullptr};
|
||||||
|
std::vector<sd_image_t> pmid_images;
|
||||||
|
|
||||||
|
std::vector<sd_image_t> ref_images;
|
||||||
|
ref_images.reserve(images_bytes.size());
|
||||||
|
for (auto& bytes : images_bytes) {
|
||||||
|
int img_w = width;
|
||||||
|
int img_h = height;
|
||||||
|
uint8_t* raw_pixels = load_image_from_memory(
|
||||||
|
reinterpret_cast<const char*>(bytes.data()),
|
||||||
|
bytes.size(),
|
||||||
|
img_w, img_h,
|
||||||
|
width, height, 3);
|
||||||
|
|
||||||
|
if (!raw_pixels) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
sd_image_t img{(uint32_t)img_w, (uint32_t)img_h, 3, raw_pixels};
|
||||||
|
ref_images.push_back(img);
|
||||||
|
}
|
||||||
|
|
||||||
|
sd_image_t mask_image = {0};
|
||||||
|
if (!mask_bytes.empty()) {
|
||||||
|
int mask_w = width;
|
||||||
|
int mask_h = height;
|
||||||
|
uint8_t* mask_raw = load_image_from_memory(
|
||||||
|
reinterpret_cast<const char*>(mask_bytes.data()),
|
||||||
|
mask_bytes.size(),
|
||||||
|
mask_w, mask_h,
|
||||||
|
width, height, 1);
|
||||||
|
mask_image = {(uint32_t)mask_w, (uint32_t)mask_h, 1, mask_raw};
|
||||||
|
} else {
|
||||||
|
mask_image.width = width;
|
||||||
|
mask_image.height = height;
|
||||||
|
mask_image.channel = 1;
|
||||||
|
mask_image.data = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
sd_img_gen_params_t img_gen_params = {
|
||||||
|
gen_params.lora_vec.data(),
|
||||||
|
static_cast<uint32_t>(gen_params.lora_vec.size()),
|
||||||
|
gen_params.prompt.c_str(),
|
||||||
|
gen_params.negative_prompt.c_str(),
|
||||||
|
gen_params.clip_skip,
|
||||||
|
init_image,
|
||||||
|
ref_images.data(),
|
||||||
|
(int)ref_images.size(),
|
||||||
|
gen_params.auto_resize_ref_image,
|
||||||
|
gen_params.increase_ref_index,
|
||||||
|
mask_image,
|
||||||
|
gen_params.width,
|
||||||
|
gen_params.height,
|
||||||
|
gen_params.sample_params,
|
||||||
|
gen_params.strength,
|
||||||
|
gen_params.seed,
|
||||||
|
gen_params.batch_count,
|
||||||
|
control_image,
|
||||||
|
gen_params.control_strength,
|
||||||
|
{
|
||||||
|
pmid_images.data(),
|
||||||
|
(int)pmid_images.size(),
|
||||||
|
gen_params.pm_id_embed_path.c_str(),
|
||||||
|
gen_params.pm_style_strength,
|
||||||
|
}, // pm_params
|
||||||
|
ctx_params.vae_tiling_params,
|
||||||
|
gen_params.easycache_params,
|
||||||
|
};
|
||||||
|
|
||||||
|
sd_image_t* results = nullptr;
|
||||||
|
int num_results = 0;
|
||||||
|
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(sd_ctx_mutex);
|
||||||
|
results = generate_image(sd_ctx, &img_gen_params);
|
||||||
|
num_results = gen_params.batch_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
json out;
|
||||||
|
out["created"] = iso_timestamp_now();
|
||||||
|
out["data"] = json::array();
|
||||||
|
out["output_format"] = output_format;
|
||||||
|
|
||||||
|
for (int i = 0; i < num_results; i++) {
|
||||||
|
if (results[i].data == nullptr)
|
||||||
|
continue;
|
||||||
|
auto image_bytes = write_image_to_vector(output_format == "jpeg" ? ImageFormat::JPEG : ImageFormat::PNG,
|
||||||
|
results[i].data,
|
||||||
|
results[i].width,
|
||||||
|
results[i].height,
|
||||||
|
results[i].channel,
|
||||||
|
output_compression);
|
||||||
|
std::string b64 = base64_encode(image_bytes);
|
||||||
|
json item;
|
||||||
|
item["b64_json"] = b64;
|
||||||
|
out["data"].push_back(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
res.set_content(out.dump(), "application/json");
|
||||||
|
res.status = 200;
|
||||||
|
|
||||||
|
if (init_image.data) {
|
||||||
|
stbi_image_free(init_image.data);
|
||||||
|
}
|
||||||
|
if (mask_image.data) {
|
||||||
|
stbi_image_free(mask_image.data);
|
||||||
|
}
|
||||||
|
for (auto ref_image : ref_images) {
|
||||||
|
stbi_image_free(ref_image.data);
|
||||||
|
}
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
res.status = 500;
|
||||||
|
json err;
|
||||||
|
err["error"] = "server_error";
|
||||||
|
err["message"] = e.what();
|
||||||
|
res.set_content(err.dump(), "application/json");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
printf("listening on: %s:%d\n", svr_params.listen_ip.c_str(), svr_params.listen_port);
|
||||||
|
svr.listen(svr_params.listen_ip, svr_params.listen_port);
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
free_sd_ctx(sd_ctx);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
for f in *.cpp *.h *.hpp examples/cli/*.cpp examples/cli/*.h; do
|
for f in *.cpp *.h *.hpp examples/cli/*.cpp examples/common/*.hpp examples/cli/*.h examples/server/*.cpp; do
|
||||||
[[ "$f" == vocab* ]] && continue
|
[[ "$f" == vocab* ]] && continue
|
||||||
echo "formatting '$f'"
|
echo "formatting '$f'"
|
||||||
# if [ "$f" != "stable-diffusion.h" ]; then
|
# if [ "$f" != "stable-diffusion.h" ]; then
|
||||||
|
|||||||
7
thirdparty/README.md
vendored
7
thirdparty/README.md
vendored
@ -1,3 +1,10 @@
|
|||||||
- json.hpp library from: https://github.com/nlohmann/json
|
- json.hpp library from: https://github.com/nlohmann/json
|
||||||
|
- LICENSE: https://github.com/nlohmann/json/blob/develop/LICENSE.MIT
|
||||||
- ZIP Library from: https://github.com/kuba--/zip
|
- ZIP Library from: https://github.com/kuba--/zip
|
||||||
|
LICENSE: https://github.com/kuba--/zip/blob/master/LICENSE.txt
|
||||||
- darts.h from: https://github.com/google/sentencepiece/tree/master/third_party/darts_clone
|
- darts.h from: https://github.com/google/sentencepiece/tree/master/third_party/darts_clone
|
||||||
|
- LICENSE: https://github.com/google/sentencepiece/blob/master/third_party/darts_clone/LICENSE
|
||||||
|
- httplib.h from: https://github.com/yhirose/cpp-httplib/blob/master/httplib.h
|
||||||
|
- LICENSE: https://github.com/yhirose/cpp-httplib/blob/master/LICENSE
|
||||||
|
- stb_image.h/stb_image_resize.h/stb_image_write.h from: https://github.com/nothings/stb
|
||||||
|
- LICENSE: https://github.com/nothings/stb/blob/master/LICENSE
|
||||||
13303
thirdparty/httplib.h
vendored
Normal file
13303
thirdparty/httplib.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user