From 0c59c1ed9012d7fb2f326247468aa6353783b76d Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sun, 3 Mar 2024 15:44:15 +0800 Subject: [PATCH] allow specifying width and height --- class.py | 2 +- expose.h | 2 ++ kcpp_docs.embd | 9 +++++++++ klite.embd | 4 +++- koboldcpp.py | 10 +++++++++- otherarch/sdcpp/sdtype_adapter.cpp | 2 ++ 6 files changed, 26 insertions(+), 3 deletions(-) diff --git a/class.py b/class.py index f2f8432d1..2e3d50e1f 100644 --- a/class.py +++ b/class.py @@ -273,7 +273,7 @@ class model_backend(InferenceModel): unbantokens=False, bantokens=None, usemirostat=None, forceversion=0, nommap=self.kcpp_nommap, usemlock=False, noavx2=self.kcpp_noavx2, debugmode=self.kcpp_debugmode, skiplauncher=True, hordeconfig=None, noblas=self.kcpp_noblas, useclblast=self.kcpp_useclblast, usecublas=self.kcpp_usecublas, usevulkan=self.kcpp_usevulkan, gpulayers=self.kcpp_gpulayers, tensor_split=self.kcpp_tensor_split, config=None, - onready='', multiuser=False, foreground=False, preloadstory=None, noshift=False, remotetunnel=False, ssl=False, benchmark=False, nocertify=False) + onready='', multiuser=False, foreground=False, preloadstory=None, noshift=False, remotetunnel=False, ssl=False, benchmark=False, nocertify=False, sdconfig=None) #koboldcpp.main(kcppargs,False) #initialize library without enabling Lite http server diff --git a/expose.h b/expose.h index 212b88bc1..c228f0a5d 100644 --- a/expose.h +++ b/expose.h @@ -115,6 +115,8 @@ struct sd_generation_inputs const char * negative_prompt; const float cfg_scale; const int sample_steps; + const int width; + const int height; const int seed; const char * sample_method; }; diff --git a/kcpp_docs.embd b/kcpp_docs.embd index 2d4d18d64..365cf36f4 100644 --- a/kcpp_docs.embd +++ b/kcpp_docs.embd @@ -905,6 +905,8 @@ "negative_prompt": "ugly, deformed, censored", "cfg_scale": 5, "steps": 20, + "width": 512, + "height": 512, "seed": -1, "sampler_name": "Euler a" }, @@ -922,6 +924,12 @@ "steps": { "type": "number" }, + "width": { + "type": "number" + }, + "height": { + "type": "number" + }, "seed": { "type": "number" }, @@ -1024,6 +1032,7 @@ }; +