Adding Grok image and Fibo Edit image support
This commit is contained in:
@@ -374,7 +374,7 @@ class txt2img:
|
||||
if isinstance(providerSettings, dict):
|
||||
# Check if providerSettings already has a provider key (e.g., {"alibaba": {...}})
|
||||
if any(key in providerSettings for key in ["alibaba", "bytedance", "klingai", "openai", "pixverse",
|
||||
"bria", "lightricks", "luma", "minimax", "runway", "vidu", "elevenlabs", "bfl"]):
|
||||
"bria", "lightricks", "luma", "minimax", "runway", "vidu", "elevenlabs", "bfl", "xai"]):
|
||||
final_provider_settings = providerSettings
|
||||
else:
|
||||
# Otherwise, wrap with the extracted provider name
|
||||
|
||||
@@ -12,6 +12,9 @@ class imageInferenceInputs:
|
||||
"image": ("IMAGE", {
|
||||
"tooltip": "Specifies an image input for the inference process."
|
||||
}),
|
||||
"mask": ("IMAGE", {
|
||||
"tooltip": "Optional mask image for the inference process."
|
||||
}),
|
||||
}
|
||||
|
||||
for i in range(1, cls.MAX_REFERENCE_IMAGES + 1):
|
||||
@@ -38,11 +41,14 @@ class imageInferenceInputs:
|
||||
def createInputs(self, **kwargs):
|
||||
"""Create image inference inputs from provided parameters"""
|
||||
image = kwargs.get("image", None)
|
||||
mask = kwargs.get("mask", None)
|
||||
|
||||
inputs = {}
|
||||
|
||||
if image is not None:
|
||||
inputs["image"] = rwUtils.convertTensor2IMG(image)
|
||||
if mask is not None:
|
||||
inputs["mask"] = rwUtils.convertTensor2IMG(mask)
|
||||
|
||||
references = self._collectReferences(kwargs)
|
||||
if len(references) > 0:
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
"""
|
||||
Runware xAI Provider Settings Node
|
||||
Provides xAI-specific settings for image generation (providerSettings.xai.quality)
|
||||
"""
|
||||
|
||||
from typing import Dict, Any
|
||||
|
||||
|
||||
class RunwareXAIProviderSettings:
|
||||
"""Runware xAI Provider Settings Node"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {},
|
||||
"optional": {
|
||||
"useQuality": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include quality parameter in API request.",
|
||||
"default": False,
|
||||
}),
|
||||
"quality": (["low", "medium", "high"], {
|
||||
"default": "medium",
|
||||
"tooltip": "Quality of the output image. Can be low, medium, or high. Currently a no-op, reserved for future use.",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
DESCRIPTION = "Configure xAI-specific settings for image generation. providerSettings.xai.quality"
|
||||
RETURN_TYPES = ("RUNWAREPROVIDERSETTINGS",)
|
||||
RETURN_NAMES = ("providerSettings",)
|
||||
FUNCTION = "create_provider_settings"
|
||||
CATEGORY = "Runware/Provider Settings"
|
||||
|
||||
def create_provider_settings(self, **kwargs) -> tuple[Dict[str, Any]]:
|
||||
"""Create xAI provider settings"""
|
||||
|
||||
useQuality = kwargs.get("useQuality", False)
|
||||
quality = kwargs.get("quality", "medium")
|
||||
|
||||
settings = {}
|
||||
|
||||
if useQuality:
|
||||
settings["quality"] = quality
|
||||
|
||||
return (settings,)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"RunwareXAIProviderSettings": RunwareXAIProviderSettings,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"RunwareXAIProviderSettings": "Runware xAI Provider Settings",
|
||||
}
|
||||
@@ -101,6 +101,9 @@ class videoModelSearch:
|
||||
"Hunyuan": [
|
||||
"runware:hunyuanvideo@1.5 (HunyuanVideo-1.5)",
|
||||
],
|
||||
"xAI": [
|
||||
"xai:1@1 (xAI Video 480p)",
|
||||
],
|
||||
}
|
||||
|
||||
# Model dimensions mapping
|
||||
@@ -202,6 +205,9 @@ class videoModelSearch:
|
||||
|
||||
# Hunyuan Models
|
||||
"runware:hunyuanvideo@1.5": {"width": 848, "height": 480},
|
||||
|
||||
# xAI Models
|
||||
"xai:1@1": {"width": 480, "height": 480},
|
||||
}
|
||||
|
||||
# Model resolutions mapping
|
||||
@@ -303,6 +309,9 @@ class videoModelSearch:
|
||||
|
||||
# Hunyuan Models
|
||||
"runware:hunyuanvideo@1.5": "480p",
|
||||
|
||||
# xAI Models
|
||||
"xai:1@1": "480p",
|
||||
}
|
||||
|
||||
MODEL_ARCHITECTURES = [
|
||||
@@ -322,7 +331,8 @@ class videoModelSearch:
|
||||
"Sync",
|
||||
"Bria",
|
||||
"Creatify",
|
||||
"Hunyuan"
|
||||
"Hunyuan",
|
||||
"xAI"
|
||||
]
|
||||
|
||||
DEFAULT_DIMENSIONS = {"width": 1024, "height": 576}
|
||||
|
||||
Reference in New Issue
Block a user