Spaces:
Runtime error
Runtime error
Commit
·
a1fd8fe
1
Parent(s):
094c9f8
preload models
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import sys
|
|
4 |
from typing import Sequence, Mapping, Any, Union
|
5 |
import torch
|
6 |
import gradio as gr
|
|
|
7 |
import spaces
|
8 |
|
9 |
from huggingface_hub import hf_hub_download
|
@@ -267,6 +268,19 @@ saveimage = NODE_CLASS_MAPPINGS["SaveImage"]()
|
|
267 |
imageupscalewithmodel = NODE_CLASS_MAPPINGS["ImageUpscaleWithModel"]()
|
268 |
|
269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
@spaces.GPU(duration=60)
|
272 |
def generate_image(model_image, hairstyle_template_image):
|
|
|
4 |
from typing import Sequence, Mapping, Any, Union
|
5 |
import torch
|
6 |
import gradio as gr
|
7 |
+
from comfy import model_management
|
8 |
import spaces
|
9 |
|
10 |
from huggingface_hub import hf_hub_download
|
|
|
268 |
imageupscalewithmodel = NODE_CLASS_MAPPINGS["ImageUpscaleWithModel"]()
|
269 |
|
270 |
|
271 |
+
model_loaders = [
|
272 |
+
checkpointloadersimple_50,
|
273 |
+
controlnetloader_73,
|
274 |
+
florence2modelloader_204,
|
275 |
+
checkpointloadersimple_319,
|
276 |
+
loraloader_338,
|
277 |
+
loraloader_353,
|
278 |
+
controlnetloader_389,
|
279 |
+
faceanalysismodels_506,
|
280 |
+
upscalemodelloader_835,
|
281 |
+
layerutility_imageblend_v2
|
282 |
+
]
|
283 |
+
model_management.load_models_gpu(model_loaders)
|
284 |
|
285 |
@spaces.GPU(duration=60)
|
286 |
def generate_image(model_image, hairstyle_template_image):
|