improvement pipeline to load models only on node first run(models are downloaded on init)

This commit is contained in:
rodrigoskohl
2025-02-18 20:04:29 -03:00
parent e328c48b9a
commit 66728f3495
3 changed files with 53 additions and 37 deletions
+3 -1
View File
@@ -24,6 +24,7 @@ class InteriorDesignNode:
"img_size": ("INT", {"default": 768, "min": 256, "max": 768, "step": 8}),
"img_dept_threshold": ("FLOAT", {"default": 0.5, "min": 0.1, "max": 0.99, "step": 0.01}),
"img_seg_threshold": ("FLOAT", {"default": 0.5, "min": 0.1, "max": 0.99, "step": 0.01}),
"ip_adapter_scale": ("FLOAT", {"default": 0.40, "min": 0.01, "max": 1.0, "step": 0.01}),
},
"optional": {
"negative": ("STRING",{"forceInput": True}), # Prompt de descrição do design
@@ -36,8 +37,9 @@ class InteriorDesignNode:
FUNCTION = "process" # Função que será executada
CATEGORY = "interior_design" # Categoria para o ComfyUI
def process(self, image, positive, guidance_scale, num_steps, strength, seed, img_size, img_dept_threshold, img_seg_threshold, negative=None):
def process(self, image, positive, guidance_scale, num_steps, strength, seed, img_size, img_dept_threshold, img_seg_threshold, ip_adapter_scale, negative=None):
# Pré-processamento da imagem
self.pipeline.ip_adapter_scale = ip_adapter_scale
self.pipeline.seed = seed
if negative is not None:
self.pipeline.neg_prompt = negative