multimodalart HF staff commited on
Commit
4a78495
1 Parent(s): b9d58bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -136,13 +136,6 @@ DEPTH_MODEL = downloadandloaddepthanythingv2model.loadmodel(
136
  model="depth_anything_v2_vitl_fp32.safetensors"
137
  )
138
 
139
- model_management.load_models_gpu([
140
- CLIP_MODEL[0].patcher,
141
- VAE_MODEL[0].patcher,
142
- UNET_MODEL[0].patcher,
143
- CLIP_VISION_MODEL[0].patcher,
144
- ])
145
-
146
  cliptextencode = CLIPTextEncode()
147
  loadimage = LoadImage()
148
  vaeencode = VAEEncode()
@@ -162,6 +155,13 @@ getimagesizeandcount = NODE_CLASS_MAPPINGS["GetImageSizeAndCount"]()
162
  depthanything_v2 = NODE_CLASS_MAPPINGS["DepthAnything_V2"]()
163
  imageresize = NODE_CLASS_MAPPINGS["ImageResize+"]()
164
 
 
 
 
 
 
 
 
165
  @spaces.GPU
166
  def generate_image(prompt, structure_image, style_image, depth_strength=15, style_strength=0.5, progress=gr.Progress(track_tqdm=True)) -> str:
167
  """Main generation function that processes inputs and returns the path to the generated image."""
 
136
  model="depth_anything_v2_vitl_fp32.safetensors"
137
  )
138
 
 
 
 
 
 
 
 
139
  cliptextencode = CLIPTextEncode()
140
  loadimage = LoadImage()
141
  vaeencode = VAEEncode()
 
155
  depthanything_v2 = NODE_CLASS_MAPPINGS["DepthAnything_V2"]()
156
  imageresize = NODE_CLASS_MAPPINGS["ImageResize+"]()
157
 
158
+ model_management.load_models_gpu([
159
+ CLIP_MODEL[0].patcher,
160
+ VAE_MODEL[0].patcher,
161
+ UNET_MODEL[0],
162
+ CLIP_VISION_MODEL[0].patcher,
163
+ ])
164
+
165
  @spaces.GPU
166
  def generate_image(prompt, structure_image, style_image, depth_strength=15, style_strength=0.5, progress=gr.Progress(track_tqdm=True)) -> str:
167
  """Main generation function that processes inputs and returns the path to the generated image."""