Reorder VFI Optimizer outputs: images first, settings second
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
10
nodes.py
10
nodes.py
@@ -747,22 +747,22 @@ class VFIOptimizer:
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("VFI_SETTINGS", "IMAGE")
|
RETURN_TYPES = ("IMAGE", "VFI_SETTINGS")
|
||||||
RETURN_NAMES = ("settings", "images")
|
RETURN_NAMES = ("images", "settings")
|
||||||
FUNCTION = "optimize"
|
FUNCTION = "optimize"
|
||||||
CATEGORY = "video/Tween"
|
CATEGORY = "video/Tween"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _conservative_defaults(images):
|
def _conservative_defaults(images):
|
||||||
"""Return safe fallback settings with image passthrough."""
|
"""Return safe fallback settings with image passthrough."""
|
||||||
return ({
|
return (images, {
|
||||||
"batch_size": 1,
|
"batch_size": 1,
|
||||||
"chunk_size": 0,
|
"chunk_size": 0,
|
||||||
"keep_device": True,
|
"keep_device": True,
|
||||||
"all_on_gpu": False,
|
"all_on_gpu": False,
|
||||||
"clear_cache_after_n_frames": 5,
|
"clear_cache_after_n_frames": 5,
|
||||||
"_info": {"source": "conservative_defaults"},
|
"_info": {"source": "conservative_defaults"},
|
||||||
}, images)
|
})
|
||||||
|
|
||||||
def optimize(self, images, model, min_free_vram_gb, force_batch_size=0):
|
def optimize(self, images, model, min_free_vram_gb, force_batch_size=0):
|
||||||
if images.shape[0] < 2 or not torch.cuda.is_available():
|
if images.shape[0] < 2 or not torch.cuda.is_available():
|
||||||
@@ -881,7 +881,7 @@ class VFIOptimizer:
|
|||||||
f"calibration={elapsed*1000:.0f}ms, res={W}x{H}"
|
f"calibration={elapsed*1000:.0f}ms, res={W}x{H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
return (settings, images)
|
return (images, settings)
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user