Connect 2D upscaler through H3 parameter output

This commit is contained in:
2026-11-12 09:05:49 +00:00
parent 6a899bfacb
commit 100f17d356
3 changed files with 106 additions and 18 deletions
+46 -1
View File
@@ -14,6 +14,47 @@ def _upscaler_module():
return module
class DumasMMH3LatentUpscale2DModelParams:
"""Provide the H3_UPSCALE_PARAM contract for the DUMAS 2D path."""
@classmethod
def INPUT_TYPES(cls):
import folder_paths
names = [
name for name in folder_paths.get_filename_list("latent_upscale_models")
if str(name).lower().endswith((".safetensors", ".pth"))
]
return {"required": {
"model_name": (names or ["(place model in models/latent_upscale_models)"],),
"device": (["cuda", "rocm", "cpu"], {"default": "cuda"}),
"precision": (["fp32", "fp16", "bf16"], {"default": "fp16"}),
"scale": ("FLOAT", {"default": 2.0, "min": 1.0, "max": 4.0, "step": 0.05}),
"tile_size": ("INT", {"default": 64, "min": 8, "max": 1024, "step": 8}),
"tile_overlap": ("INT", {"default": 8, "min": 0, "max": 128, "step": 1}),
"sharpness": ("INT", {"default": 1, "min": 1, "max": 6, "step": 1}),
}}
RETURN_TYPES = ("H3_UPSCALE_PARAM",)
RETURN_NAMES = ("latent_upscale_param",)
FUNCTION = "build"
CATEGORY = "Dumas/MiniMax H3/Upscale"
def build(self, model_name, device, precision, scale, tile_size, tile_overlap, sharpness):
if str(model_name).startswith("("):
raise ValueError("Place the 2D H3 model in models/latent_upscale_models")
return ({
"dumas_h3_2d": True,
"model_name": str(model_name),
"device": str(device),
"precision": str(precision),
"scale": float(scale),
"tile_size": int(tile_size),
"tile_overlap": int(tile_overlap),
"sharpness": int(sharpness),
},)
class DumasMMH3LatentUpscale2D:
"""Apply the MiniMax H3 2D upscaler using X/Y tiles only."""
@@ -113,7 +154,11 @@ class DumasMMH3LatentUpscale2D:
)
NODE_CLASS_MAPPINGS = {"DumasMMH3LatentUpscale2D": DumasMMH3LatentUpscale2D}
NODE_CLASS_MAPPINGS = {
"DumasMMH3LatentUpscale2DModelParams": DumasMMH3LatentUpscale2DModelParams,
"DumasMMH3LatentUpscale2D": DumasMMH3LatentUpscale2D,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"DumasMMH3LatentUpscale2D": "DUMAS MiniMax-H3 2D Spatial Latent Upscale",
"DumasMMH3LatentUpscale2DModelParams": "DUMAS MiniMax-H3 2D Latent Upscale Model",
}