Merge pull request #128 from storyicon/main

feat: reduce unnecessary time consumption
pull/131/head
hako-mikan 2023-11-09 19:08:49 +09:00 committed by GitHub
commit c9530db739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -313,9 +313,8 @@ class Script(modules.scripts.Script):
princ = elemsets
def before_process_batch(self, p, loraratios,useblocks,xyzsetting,xtype,xmen,ytype,ymen,ztype,zmen,exmen,eymen,ecount,diffcol,thresh,revxy,elemental,elemsets,debug,**kwargs):
resetmemory()
if useblocks:
resetmemory()
if not self.isnet: p.disable_extra_networks = False
global prompts
prompts = kwargs["prompts"].copy()
@ -330,6 +329,8 @@ class Script(modules.scripts.Script):
if not self.isnet: loradealer(self, o_prompts ,self.lratios,self.elementals)
def postprocess(self, p, processed, presets,useblocks,xyzsetting,xtype,xmen,ytype,ymen,ztype,zmen,exmen,eymen,ecount,diffcol,thresh,revxy,elemental,elemsets,debug,*args):
if not useblocks:
return
lora = importer(self)
lora.loaded_loras.clear()
global lxyz,lzyx,xyelem
@ -343,6 +344,8 @@ class Script(modules.scripts.Script):
loradealer(self, kwargs["prompts"] ,self.lratios,self.elementals,kwargs["extra_network_data"])
def run(self,p,presets,useblocks,xyzsetting,xtype,xmen,ytype,ymen,ztype,zmen,exmen,eymen,ecount,diffcol,thresh,revxy,elemental,elemsets,debug):
if not useblocks:
return
self.log={}
self.log["pass XYZ"] = True
self.log["XYZsets"] = xyzsetting