lllyasviel commited on
Commit
435d6d2
·
1 Parent(s): 6d23a83
Files changed (1) hide show
  1. webui.py +3 -0
webui.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import random
3
 
4
  from comfy.sd import load_checkpoint_guess_config
 
5
 
6
  from nodes import (
7
  VAEDecode,
@@ -26,6 +27,7 @@ opVAEDecode = VAEDecode()
26
 
27
  positive_conditions = opCLIPTextEncode.encode(clip=xl_base_clip, text='a handsome man in forest')[0]
28
  negative_conditions = opCLIPTextEncode.encode(clip=xl_base_clip, text='bad, ugly')[0]
 
29
 
30
  initial_latent_image = opEmptyLatentImage.generate(width=1024, height=1024, batch_size=1)[0]
31
 
@@ -44,6 +46,7 @@ samples = opKSamplerAdvanced.sample(
44
  negative=negative_conditions,
45
  latent_image=initial_latent_image,
46
  )[0]
 
47
 
48
  vae_decoded = opVAEDecode.decode(samples=samples, vae=xl_base_vae)[0]
49
 
 
2
  import random
3
 
4
  from comfy.sd import load_checkpoint_guess_config
5
+ from comfy.model_management import unload_model
6
 
7
  from nodes import (
8
  VAEDecode,
 
27
 
28
  positive_conditions = opCLIPTextEncode.encode(clip=xl_base_clip, text='a handsome man in forest')[0]
29
  negative_conditions = opCLIPTextEncode.encode(clip=xl_base_clip, text='bad, ugly')[0]
30
+ unload_model()
31
 
32
  initial_latent_image = opEmptyLatentImage.generate(width=1024, height=1024, batch_size=1)[0]
33
 
 
46
  negative=negative_conditions,
47
  latent_image=initial_latent_image,
48
  )[0]
49
+ unload_model()
50
 
51
  vae_decoded = opVAEDecode.decode(samples=samples, vae=xl_base_vae)[0]
52