add trellis support
This commit is contained in:
@@ -8,6 +8,7 @@ class threeDInference:
|
||||
# Available 3D models
|
||||
THREED_MODELS = {
|
||||
"Meta SAM 3D": "meta:sam@3d",
|
||||
"TRELLIS.2": "microsoft:trellis-2@4b",
|
||||
}
|
||||
|
||||
# Output formats
|
||||
@@ -38,9 +39,23 @@ class threeDInference:
|
||||
}),
|
||||
},
|
||||
"optional": {
|
||||
"useOutputQuality": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include outputQuality in API request.",
|
||||
"default": False,
|
||||
}),
|
||||
"outputQuality": ("INT", {
|
||||
"tooltip": "Output quality (0-100). Only used when 'Use Output Quality' is enabled.",
|
||||
"default": 95,
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"step": 1,
|
||||
}),
|
||||
"inputs": ("RUNWARE3DINFERENCEINPUTS", {
|
||||
"tooltip": "Connect a Runware 3D Inference Inputs node to provide image and mask inputs.",
|
||||
}),
|
||||
"settings": ("RUNWARE3DINFERENCESETTINGS", {
|
||||
"tooltip": "Connect Runware 3D Inference Settings node for textureSize, decimationTarget, remesh, resolution, sparseStructure, shapeSlat, texSlat.",
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -56,7 +71,10 @@ class threeDInference:
|
||||
positivePrompt = kwargs.get("positivePrompt", "")
|
||||
seed = kwargs.get("seed", 1)
|
||||
outputFormat = kwargs.get("outputFormat", "GLB")
|
||||
use_output_quality = kwargs.get("useOutputQuality", False)
|
||||
output_quality = kwargs.get("outputQuality", 95)
|
||||
inputs = kwargs.get("inputs", None)
|
||||
settings = kwargs.get("settings", None)
|
||||
|
||||
# Get model AIR code
|
||||
model = self.THREED_MODELS.get(modelName, "meta:sam@3d")
|
||||
@@ -82,10 +100,17 @@ class threeDInference:
|
||||
# Add seed
|
||||
genConfig[0]["seed"] = seed
|
||||
|
||||
if use_output_quality:
|
||||
genConfig[0]["outputQuality"] = int(output_quality)
|
||||
|
||||
# Handle inputs from 3D Inference Inputs node
|
||||
if inputs is not None and isinstance(inputs, dict) and len(inputs) > 0:
|
||||
genConfig[0]["inputs"] = inputs
|
||||
|
||||
# Handle settings from 3D Inference Settings node
|
||||
if settings is not None and isinstance(settings, dict) and len(settings) > 0:
|
||||
genConfig[0]["settings"] = settings
|
||||
|
||||
try:
|
||||
print(f"[DEBUG] Sending 3D Inference Request:")
|
||||
print(f"[DEBUG] Request Payload: {rwUtils.safe_json_dumps(genConfig, indent=2)}")
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
"""
|
||||
Runware 3D Inference Settings Node
|
||||
Main settings for 3D inference: textureSize, decimationTarget, remesh, resolution,
|
||||
and sub-configs sparseStructure, shapeSlat, texSlat from connected nodes.
|
||||
"""
|
||||
|
||||
from typing import Dict, Any
|
||||
|
||||
|
||||
class Runware3DInferenceSettings:
|
||||
"""Runware 3D Inference Settings Node"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {},
|
||||
"optional": {
|
||||
"useTextureSize": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include textureSize in settings",
|
||||
"default": False,
|
||||
}),
|
||||
"textureSize": ("INT", {
|
||||
"tooltip": "Texture size for 3D output (1024-4096, step 1024). Only used when enabled.",
|
||||
"default": 2048,
|
||||
"min": 1024,
|
||||
"max": 4096,
|
||||
"step": 1024,
|
||||
}),
|
||||
"useDecimationTarget": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include decimationTarget in settings",
|
||||
"default": False,
|
||||
}),
|
||||
"decimationTarget": ("INT", {
|
||||
"tooltip": "Decimation target for mesh (100000-1000000). Only used when enabled.",
|
||||
"default": 500000,
|
||||
"min": 100000,
|
||||
"max": 1000000,
|
||||
"step": 10000,
|
||||
}),
|
||||
"useRemesh": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include remesh in settings",
|
||||
"default": False,
|
||||
}),
|
||||
"remesh": ("BOOLEAN", {
|
||||
"tooltip": "Whether to remesh the output. Only used when enabled.",
|
||||
"default": True,
|
||||
}),
|
||||
"useResolution": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include resolution in settings",
|
||||
"default": False,
|
||||
}),
|
||||
"resolution": ([512, 1024, 1536], {
|
||||
"tooltip": "Resolution for 3D generation (512, 1024, or 1536). Only used when enabled.",
|
||||
"default": 1024,
|
||||
}),
|
||||
"sparseStructure": ("RUNWARE3DINFERENCESETTINGSLAT", {
|
||||
"tooltip": "Connect Runware 3D Inference Settings Sparse Structure node.",
|
||||
}),
|
||||
"shapeSlat": ("RUNWARE3DINFERENCESETTINGSLAT", {
|
||||
"tooltip": "Connect Runware 3D Inference Settings Shape Slat node.",
|
||||
}),
|
||||
"texSlat": ("RUNWARE3DINFERENCESETTINGSLAT", {
|
||||
"tooltip": "Connect Runware 3D Inference Settings Tex Slat node.",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("RUNWARE3DINFERENCESETTINGS",)
|
||||
RETURN_NAMES = ("Settings",)
|
||||
FUNCTION = "create"
|
||||
CATEGORY = "Runware"
|
||||
DESCRIPTION = "Configure Runware 3D Inference settings: texture, decimation, remesh, resolution, and lat configs."
|
||||
|
||||
def create(self, **kwargs) -> tuple[Dict[str, Any]]:
|
||||
settings: Dict[str, Any] = {}
|
||||
|
||||
if kwargs.get("useTextureSize", False):
|
||||
settings["textureSize"] = int(kwargs.get("textureSize", 2048))
|
||||
if kwargs.get("useDecimationTarget", False):
|
||||
settings["decimationTarget"] = int(kwargs.get("decimationTarget", 500000))
|
||||
if kwargs.get("useRemesh", False):
|
||||
settings["remesh"] = bool(kwargs.get("remesh", True))
|
||||
if kwargs.get("useResolution", False):
|
||||
settings["resolution"] = int(kwargs.get("resolution", 1024))
|
||||
|
||||
sparse = kwargs.get("sparseStructure", None)
|
||||
if sparse is not None and isinstance(sparse, dict) and len(sparse) > 0:
|
||||
settings["sparseStructure"] = sparse
|
||||
|
||||
shape = kwargs.get("shapeSlat", None)
|
||||
if shape is not None and isinstance(shape, dict) and len(shape) > 0:
|
||||
settings["shapeSlat"] = shape
|
||||
|
||||
tex = kwargs.get("texSlat", None)
|
||||
if tex is not None and isinstance(tex, dict) and len(tex) > 0:
|
||||
settings["texSlat"] = tex
|
||||
|
||||
return (settings,)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"Runware3DInferenceSettings": Runware3DInferenceSettings,
|
||||
}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"Runware3DInferenceSettings": "Runware 3D Inference Settings",
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
"""
|
||||
Runware 3D Inference Settings Shape Slat Node
|
||||
Outputs shapeSlat config: guidanceStrength, guidanceRescale, steps, rescaleT
|
||||
"""
|
||||
|
||||
from typing import Dict, Any
|
||||
|
||||
|
||||
class Runware3DInferenceSettingsShapeSlat:
|
||||
"""Runware 3D Inference Settings Shape Slat Node"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {},
|
||||
"optional": {
|
||||
"useGuidanceStrength": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include guidanceStrength in shapeSlat",
|
||||
"default": False,
|
||||
}),
|
||||
"guidanceStrength": ("FLOAT", {
|
||||
"tooltip": "Guidance strength for shape slat (1.0-10.0). Only used when enabled.",
|
||||
"default": 7.5,
|
||||
"min": 1.0,
|
||||
"max": 10.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
"useGuidanceRescale": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include guidanceRescale in shapeSlat",
|
||||
"default": False,
|
||||
}),
|
||||
"guidanceRescale": ("FLOAT", {
|
||||
"tooltip": "Guidance rescale for shape slat. Only used when enabled.",
|
||||
"default": 0.5,
|
||||
"min": 0.0,
|
||||
"max": 1.0,
|
||||
"step": 0.05,
|
||||
}),
|
||||
"useSteps": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include steps in shapeSlat",
|
||||
"default": False,
|
||||
}),
|
||||
"steps": ("INT", {
|
||||
"tooltip": "Number of steps for shape slat (1-50). Only used when enabled.",
|
||||
"default": 12,
|
||||
"min": 1,
|
||||
"max": 50,
|
||||
"step": 1,
|
||||
}),
|
||||
"useRescaleT": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include rescaleT in shapeSlat",
|
||||
"default": False,
|
||||
}),
|
||||
"rescaleT": ("FLOAT", {
|
||||
"tooltip": "Rescale T for shape slat (1.0-6.0). Only used when enabled.",
|
||||
"default": 3.0,
|
||||
"min": 1.0,
|
||||
"max": 6.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("RUNWARE3DINFERENCESETTINGSLAT",)
|
||||
RETURN_NAMES = ("Shape Slat",)
|
||||
FUNCTION = "create"
|
||||
CATEGORY = "Runware"
|
||||
DESCRIPTION = "Configure shape slat parameters for Runware 3D Inference settings."
|
||||
|
||||
def create(self, **kwargs) -> tuple[Dict[str, Any]]:
|
||||
out: Dict[str, Any] = {}
|
||||
if kwargs.get("useGuidanceStrength", False):
|
||||
out["guidanceStrength"] = float(kwargs.get("guidanceStrength", 7.5))
|
||||
if kwargs.get("useGuidanceRescale", False):
|
||||
out["guidanceRescale"] = float(kwargs.get("guidanceRescale", 0.5))
|
||||
if kwargs.get("useSteps", False):
|
||||
out["steps"] = int(kwargs.get("steps", 12))
|
||||
if kwargs.get("useRescaleT", False):
|
||||
out["rescaleT"] = float(kwargs.get("rescaleT", 3.0))
|
||||
return (out,)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"Runware3DInferenceSettingsShapeSlat": Runware3DInferenceSettingsShapeSlat,
|
||||
}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"Runware3DInferenceSettingsShapeSlat": "Runware 3D Inference Settings Shape Slat",
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
"""
|
||||
Runware 3D Inference Settings Sparse Structure Node
|
||||
Outputs sparseStructure config: guidanceStrength, guidanceRescale, steps, rescaleT
|
||||
"""
|
||||
|
||||
from typing import Dict, Any
|
||||
|
||||
|
||||
class Runware3DInferenceSettingsSparseStructure:
|
||||
"""Runware 3D Inference Settings Sparse Structure Node"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {},
|
||||
"optional": {
|
||||
"useGuidanceStrength": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include guidanceStrength in sparseStructure",
|
||||
"default": False,
|
||||
}),
|
||||
"guidanceStrength": ("FLOAT", {
|
||||
"tooltip": "Guidance strength for sparse structure (1.0-10.0). Only used when enabled.",
|
||||
"default": 7.5,
|
||||
"min": 1.0,
|
||||
"max": 10.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
"useGuidanceRescale": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include guidanceRescale in sparseStructure",
|
||||
"default": False,
|
||||
}),
|
||||
"guidanceRescale": ("FLOAT", {
|
||||
"tooltip": "Guidance rescale for sparse structure. Only used when enabled.",
|
||||
"default": 0.7,
|
||||
"min": 0.0,
|
||||
"max": 1.0,
|
||||
"step": 0.05,
|
||||
}),
|
||||
"useSteps": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include steps in sparseStructure",
|
||||
"default": False,
|
||||
}),
|
||||
"steps": ("INT", {
|
||||
"tooltip": "Number of steps for sparse structure (1-50). Only used when enabled.",
|
||||
"default": 12,
|
||||
"min": 1,
|
||||
"max": 50,
|
||||
"step": 1,
|
||||
}),
|
||||
"useRescaleT": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include rescaleT in sparseStructure",
|
||||
"default": False,
|
||||
}),
|
||||
"rescaleT": ("FLOAT", {
|
||||
"tooltip": "Rescale T for sparse structure (1.0-6.0). Only used when enabled.",
|
||||
"default": 5.0,
|
||||
"min": 1.0,
|
||||
"max": 6.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("RUNWARE3DINFERENCESETTINGSLAT",)
|
||||
RETURN_NAMES = ("Sparse Structure",)
|
||||
FUNCTION = "create"
|
||||
CATEGORY = "Runware"
|
||||
DESCRIPTION = "Configure sparse structure parameters for Runware 3D Inference settings."
|
||||
|
||||
def create(self, **kwargs) -> tuple[Dict[str, Any]]:
|
||||
out: Dict[str, Any] = {}
|
||||
if kwargs.get("useGuidanceStrength", False):
|
||||
out["guidanceStrength"] = float(kwargs.get("guidanceStrength", 7.5))
|
||||
if kwargs.get("useGuidanceRescale", False):
|
||||
out["guidanceRescale"] = float(kwargs.get("guidanceRescale", 0.7))
|
||||
if kwargs.get("useSteps", False):
|
||||
out["steps"] = int(kwargs.get("steps", 12))
|
||||
if kwargs.get("useRescaleT", False):
|
||||
out["rescaleT"] = float(kwargs.get("rescaleT", 5.0))
|
||||
return (out,)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"Runware3DInferenceSettingsSparseStructure": Runware3DInferenceSettingsSparseStructure,
|
||||
}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"Runware3DInferenceSettingsSparseStructure": "Runware 3D Inference Settings Sparse Structure",
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
"""
|
||||
Runware 3D Inference Settings Tex Slat Node
|
||||
Outputs texSlat config: guidanceStrength, guidanceRescale, steps, rescaleT
|
||||
"""
|
||||
|
||||
from typing import Dict, Any
|
||||
|
||||
|
||||
class Runware3DInferenceSettingsTexSlat:
|
||||
"""Runware 3D Inference Settings Tex Slat Node"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {},
|
||||
"optional": {
|
||||
"useGuidanceStrength": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include guidanceStrength in texSlat",
|
||||
"default": False,
|
||||
}),
|
||||
"guidanceStrength": ("FLOAT", {
|
||||
"tooltip": "Guidance strength for tex slat (1.0-10.0). Only used when enabled.",
|
||||
"default": 1.0,
|
||||
"min": 1.0,
|
||||
"max": 10.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
"useGuidanceRescale": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include guidanceRescale in texSlat",
|
||||
"default": False,
|
||||
}),
|
||||
"guidanceRescale": ("FLOAT", {
|
||||
"tooltip": "Guidance rescale for tex slat. Only used when enabled.",
|
||||
"default": 0.0,
|
||||
"min": 0.0,
|
||||
"max": 1.0,
|
||||
"step": 0.05,
|
||||
}),
|
||||
"useSteps": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include steps in texSlat",
|
||||
"default": False,
|
||||
}),
|
||||
"steps": ("INT", {
|
||||
"tooltip": "Number of steps for tex slat (1-50). Only used when enabled.",
|
||||
"default": 12,
|
||||
"min": 1,
|
||||
"max": 50,
|
||||
"step": 1,
|
||||
}),
|
||||
"useRescaleT": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include rescaleT in texSlat",
|
||||
"default": False,
|
||||
}),
|
||||
"rescaleT": ("FLOAT", {
|
||||
"tooltip": "Rescale T for tex slat (1.0-6.0). Only used when enabled.",
|
||||
"default": 3.0,
|
||||
"min": 1.0,
|
||||
"max": 6.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("RUNWARE3DINFERENCESETTINGSLAT",)
|
||||
RETURN_NAMES = ("Tex Slat",)
|
||||
FUNCTION = "create"
|
||||
CATEGORY = "Runware"
|
||||
DESCRIPTION = "Configure tex slat parameters for Runware 3D Inference settings."
|
||||
|
||||
def create(self, **kwargs) -> tuple[Dict[str, Any]]:
|
||||
out: Dict[str, Any] = {}
|
||||
if kwargs.get("useGuidanceStrength", False):
|
||||
out["guidanceStrength"] = float(kwargs.get("guidanceStrength", 1.0))
|
||||
if kwargs.get("useGuidanceRescale", False):
|
||||
out["guidanceRescale"] = float(kwargs.get("guidanceRescale", 0.0))
|
||||
if kwargs.get("useSteps", False):
|
||||
out["steps"] = int(kwargs.get("steps", 12))
|
||||
if kwargs.get("useRescaleT", False):
|
||||
out["rescaleT"] = float(kwargs.get("rescaleT", 3.0))
|
||||
return (out,)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"Runware3DInferenceSettingsTexSlat": Runware3DInferenceSettingsTexSlat,
|
||||
}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"Runware3DInferenceSettingsTexSlat": "Runware 3D Inference Settings Tex Slat",
|
||||
}
|
||||
@@ -56,6 +56,7 @@ class videoModelSearch:
|
||||
"vidu:1@5 (Vidu 1.5)",
|
||||
"vidu:2@0 (Vidu 2.0)",
|
||||
"vidu:4@1 (Vidu Q3)",
|
||||
"vidu:4@2 (Vidu Q3 Turbo)",
|
||||
],
|
||||
"Wan": [
|
||||
"runware:200@1 (Wan 2.1 1.3B)",
|
||||
@@ -166,6 +167,7 @@ class videoModelSearch:
|
||||
"vidu:1@5": {"width": 1920, "height": 1080},
|
||||
"vidu:2@0": {"width": 1920, "height": 1080},
|
||||
"vidu:4@1": {"width": 1920, "height": 1080},
|
||||
"vidu:4@2": {"width": 1920, "height": 1080},
|
||||
|
||||
# Wan Models
|
||||
"runware:200@1": {"width": 853, "height": 480},
|
||||
@@ -275,6 +277,7 @@ class videoModelSearch:
|
||||
"vidu:1@5": "1080p",
|
||||
"vidu:2@0": "1080p",
|
||||
"vidu:4@1": "1080p",
|
||||
"vidu:4@2": "1080p",
|
||||
|
||||
# Wan Models
|
||||
"runware:200@1": "480p",
|
||||
|
||||
Reference in New Issue
Block a user