mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-10-03 19:45:41 +00:00
rename --sdt5xxl to --sdllm flag
This commit is contained in:
parent
7dd09f714b
commit
d6bb510251
1 changed files with 21 additions and 17 deletions
38
koboldcpp.py
38
koboldcpp.py
|
|
@ -256,6 +256,7 @@ deprecated_keys = {
|
|||
"pipelineparallel",
|
||||
"nopipelineparallel",
|
||||
"sdnotile",
|
||||
"sdt5xxl",
|
||||
"forceversion",
|
||||
"sdgendefaults",
|
||||
"flashattention",
|
||||
|
|
@ -2651,7 +2652,7 @@ def sd_get_device_override(deviceid, module=''):
|
|||
result = device_name
|
||||
return result
|
||||
|
||||
def sd_load_model(model_filename,vae_filename,t5xxl_filename,clip1_filename,clip2_filename,photomaker_filename,upscaler_filename,audio_vae_filename):
|
||||
def sd_load_model(model_filename,vae_filename,llm_filename,clip1_filename,clip2_filename,photomaker_filename,upscaler_filename,audio_vae_filename):
|
||||
global args, cached_sd_info
|
||||
inputs = sd_load_model_inputs()
|
||||
inputs = set_backend_props(inputs)
|
||||
|
|
@ -2682,7 +2683,7 @@ def sd_load_model(model_filename,vae_filename,t5xxl_filename,clip1_filename,clip
|
|||
inputs.tiled_vae_threshold = args.sdtiledvae
|
||||
inputs.vae_filename = vae_filename.encode("UTF-8")
|
||||
inputs.audio_vae_filename = audio_vae_filename.encode("UTF-8")
|
||||
inputs.t5xxl_filename = t5xxl_filename.encode("UTF-8")
|
||||
inputs.t5xxl_filename = llm_filename.encode("UTF-8")
|
||||
inputs.clip1_filename = clip1_filename.encode("UTF-8")
|
||||
inputs.clip2_filename = clip2_filename.encode("UTF-8")
|
||||
inputs.photomaker_filename = photomaker_filename.encode("UTF-8")
|
||||
|
|
@ -8965,7 +8966,7 @@ def show_gui():
|
|||
sd_loramult_var = ctk.StringVar(value="1.0")
|
||||
sd_vae_var = ctk.StringVar()
|
||||
sd_audio_vae_var = ctk.StringVar()
|
||||
sd_t5xxl_var = ctk.StringVar()
|
||||
sd_llm_var = ctk.StringVar()
|
||||
sd_clip1_var = ctk.StringVar()
|
||||
sd_clip2_var = ctk.StringVar()
|
||||
sd_photomaker_var = ctk.StringVar()
|
||||
|
|
@ -9990,7 +9991,7 @@ def show_gui():
|
|||
imglora4,imglora5 = makelabelentry(images_tab, "Multiplier:" , sd_loramult_var, 20, 50,padx=(390),singleline=True,tooltip="What mutiplier value to apply the SD LoRA with.",labelpadx=(330))
|
||||
imglora6,imglora7,imglora8 = makefileentry(images_tab, "LoRA Dir:", "Select directory for runtime lora triggers",sd_lora_var, 20, width=280, singlerow=True, dialog_type=2,tooltiptxt="Select directory containing LoRAs that can be used at runtime.\nSyntax is <lora:name:weight>")
|
||||
|
||||
makefileentry(images_tab, "T5-XXL File:", "Select T5-XXL model file (SD3, Flux, WAN)",sd_t5xxl_var, 24, width=280, singlerow=True, filetypes=[("*.safetensors *.gguf","*.safetensors *.gguf")],tooltiptxt="Select a .safetensors t5xxl file to be loaded.")
|
||||
makefileentry(images_tab, "Image LLM:", "Select image text encoder or LLM model file",sd_llm_var, 24, width=280, singlerow=True, filetypes=[("*.safetensors *.gguf","*.safetensors *.gguf")],tooltiptxt="Select a .safetensors or .gguf text encoder or LLM file for image generation.")
|
||||
makefileentry(images_tab, "Clip-1 File:", "Select First Clip model file (Clip-L for SD3 or Flux, or other vision encoder)",sd_clip1_var, 26, width=280, singlerow=True, filetypes=[("*.safetensors *.gguf","*.safetensors *.gguf")],tooltiptxt="Select a .safetensors Clip-1 file to be loaded.\nThis is Clip-L for SD3 and Flux, Clip Vision for WAN, and Qwen2.5VL for QwenImage")
|
||||
makefileentry(images_tab, "Clip-2 File:", "Select Second Clip model file (Clip-G for SD3)",sd_clip2_var, 28, width=280, singlerow=True, filetypes=[("*.safetensors *.gguf","*.safetensors *.gguf")],tooltiptxt="Select a .safetensors Clip-2 file to be loaded.\nThis is Clip-G for SD3")
|
||||
makefileentry(images_tab, "PhotoMaker:", "Select Optional PhotoMaker model file (SDXL)",sd_photomaker_var, 30, width=280, singlerow=True, filetypes=[("*.safetensors *.gguf","*.safetensors *.gguf")],tooltiptxt="PhotoMaker is a model that allows face cloning.\nSelect a .safetensors PhotoMaker file to be loaded (SDXL only).")
|
||||
|
|
@ -10381,7 +10382,7 @@ def show_gui():
|
|||
args.sdvae = sd_vae_var.get()
|
||||
args.sdaudiovae = sd_audio_vae_var.get() if sd_audio_vae_var.get() != "" else ""
|
||||
args.sdconvdirect = sd_convdirect_option(sd_convdirect_var.get())
|
||||
args.sdt5xxl = sd_t5xxl_var.get() if sd_t5xxl_var.get() != "" else ""
|
||||
args.sdllm = sd_llm_var.get() if sd_llm_var.get() != "" else ""
|
||||
args.sdclip1 = sd_clip1_var.get() if sd_clip1_var.get() != "" else ""
|
||||
args.sdclip2 = sd_clip2_var.get() if sd_clip2_var.get() != "" else ""
|
||||
args.sdphotomaker = sd_photomaker_var.get() if sd_photomaker_var.get() != "" else ""
|
||||
|
|
@ -10684,7 +10685,7 @@ def show_gui():
|
|||
sd_convdirect_var.set(sd_convdirect_option(mydict.get("sdconvdirect")))
|
||||
sd_vae_var.set(mydict["sdvae"] if ("sdvae" in mydict and mydict["sdvae"]) else "")
|
||||
sd_audio_vae_var.set(mydict["sdaudiovae"] if ("sdaudiovae" in mydict and mydict["sdaudiovae"]) else "")
|
||||
sd_t5xxl_var.set(mydict["sdt5xxl"] if ("sdt5xxl" in mydict and mydict["sdt5xxl"]) else "")
|
||||
sd_llm_var.set(mydict["sdllm"] if ("sdllm" in mydict and mydict["sdllm"]) else "")
|
||||
sd_clip1_var.set(mydict["sdclip1"] if ("sdclip1" in mydict and mydict["sdclip1"]) else "")
|
||||
sd_clip2_var.set(mydict["sdclip2"] if ("sdclip2" in mydict and mydict["sdclip2"]) else "")
|
||||
sd_photomaker_var.set(mydict["sdphotomaker"] if ("sdphotomaker" in mydict and mydict["sdphotomaker"]) else "")
|
||||
|
|
@ -11176,6 +11177,8 @@ def convert_invalid_args(args):
|
|||
dict["port"] = dict["port_param"]
|
||||
if "sdnotile" in dict and "sdtiledvae" not in dict:
|
||||
dict["sdtiledvae"] = (0 if (dict["sdnotile"]) else default_vae_tile_threshold) # convert legacy option
|
||||
if "sdt5xxl" in dict and dict["sdt5xxl"] and not dict.get("sdllm"):
|
||||
dict["sdllm"] = dict["sdt5xxl"] # convert legacy option
|
||||
if 'sdquant' in dict and type(dict['sdquant']) is bool:
|
||||
dict['sdquant'] = 2 if dict['sdquant'] else 0
|
||||
if "sdclipl" in dict and "sdclip1" not in dict:
|
||||
|
|
@ -12277,7 +12280,7 @@ autoswap_model_fields = {
|
|||
"tts": ["ttsmodel", "ttswavtokenizer"],
|
||||
"embed": ["embeddingsmodel"],
|
||||
"music": ["musicllm", "musicembeddings", "musicdiffusion", "musicvae"],
|
||||
"image": ["sdmodel", "sdt5xxl", "sdclip1", "sdclip2", "sdphotomaker", "sdupscaler", "sdvae", "sdaudiovae", "sdlora"],
|
||||
"image": ["sdmodel", "sdllm", "sdclip1", "sdclip2", "sdphotomaker", "sdupscaler", "sdvae", "sdaudiovae", "sdlora"],
|
||||
}
|
||||
|
||||
autoswap_primary_fields = {
|
||||
|
|
@ -12504,10 +12507,10 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
|
|||
dlfile = download_model_from_url(args.sdmodel,[".gguf",".safetensors"],min_file_size=500000)
|
||||
if dlfile:
|
||||
args.sdmodel = dlfile
|
||||
if args.sdt5xxl and args.sdt5xxl!="":
|
||||
dlfile = download_model_from_url(args.sdt5xxl,[".gguf",".safetensors"],min_file_size=500000)
|
||||
if args.sdllm and args.sdllm!="":
|
||||
dlfile = download_model_from_url(args.sdllm,[".gguf",".safetensors"],min_file_size=500000)
|
||||
if dlfile:
|
||||
args.sdt5xxl = dlfile
|
||||
args.sdllm = dlfile
|
||||
if args.sdclip1 and args.sdclip1!="":
|
||||
dlfile = download_model_from_url(args.sdclip1,[".gguf",".safetensors"],min_file_size=500000)
|
||||
if dlfile:
|
||||
|
|
@ -12872,7 +12875,7 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
|
|||
exit_with_error(2,f"Cannot find image model file: {imgmodel}")
|
||||
else:
|
||||
imgvae = ""
|
||||
imgt5xxl = ""
|
||||
imgllm = ""
|
||||
imgclip1 = ""
|
||||
imgclip2 = ""
|
||||
imgphotomaker = ""
|
||||
|
|
@ -12890,11 +12893,11 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
|
|||
imgaudiovae = os.path.abspath(args.sdaudiovae)
|
||||
else:
|
||||
print("Missing SD Audio VAE model file...")
|
||||
if args.sdt5xxl:
|
||||
if os.path.exists(args.sdt5xxl):
|
||||
imgt5xxl = os.path.abspath(args.sdt5xxl)
|
||||
if args.sdllm:
|
||||
if os.path.exists(args.sdllm):
|
||||
imgllm = os.path.abspath(args.sdllm)
|
||||
else:
|
||||
print("Missing SD T5-XXL model file...")
|
||||
print("Missing image LLM model file...")
|
||||
if args.sdclip1:
|
||||
if os.path.exists(args.sdclip1):
|
||||
imgclip1 = os.path.abspath(args.sdclip1)
|
||||
|
|
@ -12921,7 +12924,7 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
|
|||
friendlysdmodelname = os.path.basename(imgmodel)
|
||||
friendlysdmodelname = os.path.splitext(friendlysdmodelname)[0]
|
||||
friendlysdmodelname = sanitize_string(friendlysdmodelname)
|
||||
loadok = sd_load_model(imgmodel,imgvae,imgt5xxl,imgclip1,imgclip2,imgphotomaker,imgupscaler,imgaudiovae)
|
||||
loadok = sd_load_model(imgmodel,imgvae,imgllm,imgclip1,imgclip2,imgphotomaker,imgupscaler,imgaudiovae)
|
||||
print("Load Image Model OK: " + str(loadok))
|
||||
if not loadok:
|
||||
exitcounter = 999
|
||||
|
|
@ -13527,7 +13530,7 @@ if __name__ == '__main__':
|
|||
sdparsergroup.add_argument("--sdoffloadcpu", help="Offload image weights in RAM to save VRAM, swap into VRAM when needed.", action='store_true')
|
||||
sdparsergroup.add_argument("--sdphotomaker", metavar=('[filename]'), help="PhotoMaker is a model that allows face cloning. Specify a PhotoMaker safetensors model which will be applied replacing img2img. SDXL models only. Leave blank if unused.", default="")
|
||||
sdparsergrouplora.add_argument("--sdquant", metavar=('[quantization level 0/1/2]'), help="If specified, loads the model quantized to save memory. 0=off, 1=q8, 2=q4", type=int, choices=[0,1,2], nargs="?", const=2, default=0)
|
||||
sdparsergroup.add_argument("--sdt5xxl", metavar=('[filename]'), help="Specify a T5-XXL safetensors model. Leave blank if prebaked or unused.", default="")
|
||||
sdparsergroup.add_argument("--sdllm", metavar=('[filename]'), help="Specify an image generation text encoder or LLM (.safetensors or .gguf). Leave blank if prebaked or unused.", default="")
|
||||
sdparsergroup.add_argument("--sdthreads", metavar=('[threads]'), help="Use a different number of threads for image generation if specified. Otherwise, has the same value as --threads.", type=int, default=0)
|
||||
sdparsergroup.add_argument("--sdtiledvae", metavar=('[maxres]'), help="Adjust the automatic VAE tiling trigger for images above this size. 0 disables vae tiling.", type=int, default=default_vae_tile_threshold)
|
||||
sdparsergroup.add_argument("--sdupscaler", metavar=('[filename]'), help="You can use ESRGAN as an upscaling model to resize images. Leave blank if unused.", default="")
|
||||
|
|
@ -13587,6 +13590,7 @@ if __name__ == '__main__':
|
|||
deprecatedgroup.add_argument("--nopipelineparallel", help=argparse.SUPPRESS, action='store_true') #now to automatically enable when ubatch < batchsize and multigpu
|
||||
deprecatedgroup.add_argument("--pipelineparallel", help=argparse.SUPPRESS, action='store_true') #changed to nopipelineparallel
|
||||
deprecatedgroup.add_argument("--sdnotile", help=argparse.SUPPRESS, action='store_true') # legacy option, see sdtiledvae
|
||||
deprecatedgroup.add_argument("--sdt5xxl", help=argparse.SUPPRESS, metavar=('[filename]')) # legacy option, see sdllm
|
||||
deprecatedgroup.add_argument("--sdvaecpu", help=argparse.SUPPRESS, action='store_true') # legacy option, see sdvaedevice
|
||||
deprecatedgroup.add_argument("--sdclipgpu", help=argparse.SUPPRESS, action='store_true') # legacy option, see sdclipgpu
|
||||
deprecatedgroup.add_argument("--forceversion", help=argparse.SUPPRESS, action='store_true') #no longer used
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue