Skip to content

Commit ca0bd93

Browse files
authored
refactor: update c api (leejet#728)
1 parent a772dca commit ca0bd93

File tree

7 files changed

+1114
-1232
lines changed

7 files changed

+1114
-1232
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,14 @@ usage: ./bin/sd [arguments]
282282
283283
arguments:
284284
-h, --help show this help message and exit
285-
-M, --mode [MODEL] run mode (txt2img or img2img or convert, default: txt2img)
285+
-M, --mode [MODE] run mode, one of: [img_gen, convert], default: img_gen
286286
-t, --threads N number of threads to use during computation (default: -1)
287287
If threads <= 0, then threads will be set to the number of CPU physical cores
288288
-m, --model [MODEL] path to full model
289289
--diffusion-model path to the standalone diffusion model
290290
--clip_l path to the clip-l text encoder
291291
--clip_g path to the clip-g text encoder
292-
--t5xxl path to the the t5xxl text encoder
292+
--t5xxl path to the t5xxl text encoder
293293
--vae [VAE] path to vae
294294
--taesd [TAESD_PATH] path to taesd. Using Tiny AutoEncoder for fast decoding (low quality)
295295
--control-net [CONTROL_PATH] path to control net model
@@ -301,16 +301,18 @@ arguments:
301301
--upscale-repeats Run the ESRGAN upscaler this many times (default 1)
302302
--type [TYPE] weight type (examples: f32, f16, q4_0, q4_1, q5_0, q5_1, q8_0, q2_K, q3_K, q4_K)
303303
If not specified, the default is the type of the weight file
304+
--tensor-type-rules [EXPRESSION] weight type per tensor pattern (example: "^vae\.=f16,model\.=q8_0")
304305
--lora-model-dir [DIR] lora model directory
305306
-i, --init-img [IMAGE] path to the input image, required by img2img
306307
--mask [MASK] path to the mask image, required by img2img with mask
307308
--control-image [IMAGE] path to image condition, control net
308-
-r, --ref_image [PATH] reference image for Flux Kontext models (can be used multiple times)
309+
-r, --ref-image [PATH] reference image for Flux Kontext models (can be used multiple times)
309310
-o, --output OUTPUT path to write result image to (default: ./output.png)
310311
-p, --prompt [PROMPT] the prompt to render
311312
-n, --negative-prompt PROMPT the negative prompt (default: "")
312313
--cfg-scale SCALE unconditional guidance scale: (default: 7.0)
313-
--guidance SCALE guidance scale for img2img (default: 3.5)
314+
--img-cfg-scale SCALE image guidance scale for inpaint or instruct-pix2pix models: (default: same as --cfg-scale)
315+
--guidance SCALE distilled guidance scale for models with guidance input (default: 3.5)
314316
--slg-scale SCALE skip layer guidance (SLG) scale, only for DiT models: (default: 0)
315317
0 means disabled, a value of 2.5 is nice for sd3.5 medium
316318
--eta SCALE eta in DDIM, only for DDIM and TCD: (default: 0)
@@ -319,7 +321,7 @@ arguments:
319321
--skip-layer-end END SLG disabling point: (default: 0.2)
320322
SLG will be enabled at step int([STEPS]*[START]) and disabled at int([STEPS]*[END])
321323
--strength STRENGTH strength for noising/unnoising (default: 0.75)
322-
--style-ratio STYLE-RATIO strength for keeping input identity (default: 20%)
324+
--style-ratio STYLE-RATIO strength for keeping input identity (default: 20)
323325
--control-strength STRENGTH strength to apply Control Net (default: 0.9)
324326
1.0 corresponds to full destruction of information in init image
325327
-H, --height H image height, in pixel space (default: 512)
@@ -371,7 +373,7 @@ Using formats of different precisions will yield results of varying quality.
371373
372374
373375
```
374-
./bin/sd --mode img2img -m ../models/sd-v1-4.ckpt -p "cat with blue eyes" -i ./output.png -o ./img2img_output.png --strength 0.4
376+
./bin/sd -m ../models/sd-v1-4.ckpt -p "cat with blue eyes" -i ./output.png -o ./img2img_output.png --strength 0.4
375377
```
376378
377379
<p align="center">

docs/kontext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You can download the preconverted gguf weights from [FLUX.1-Kontext-dev-GGUF](ht
2727
For example:
2828

2929
```
30-
.\bin\Release\sd.exe -M edit -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
30+
.\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
3131
```
3232

3333

0 commit comments

Comments
 (0)