Merge pull request #39 from Runware/fix-briaInputs

Fix Bria model CFGScale validation and add image parameter to inference inputs
This commit is contained in:
Sirshendu Ganguly
2025-10-29 13:02:16 -04:00
committed by GitHub
3 changed files with 18 additions and 1 deletions
+9 -1
View File
@@ -252,7 +252,13 @@ class txt2img:
if useSteps:
genConfig[0]["steps"] = steps
if useCFGScale:
genConfig[0]["CFGScale"] = cfgScale
# Extract provider name from model (e.g., "bria:20@1" -> "bria")
provider_name = runwareModel.split(":")[0] if ":" in runwareModel else runwareModel
# Cast to int for Bria models
if provider_name.lower() == "bria":
genConfig[0]["CFGScale"] = int(cfgScale)
else:
genConfig[0]["CFGScale"] = cfgScale
if useSeed:
genConfig[0]["seed"] = seed
if useScheduler:
@@ -336,6 +342,8 @@ class txt2img:
print(f"[DEBUG] Sending Image Inference Request:")
print(f"[DEBUG] Request Payload: {json.dumps(genConfig, indent=2)}")
print(f"[DEBUG] CFGScale value from kwargs: {cfgScale}")
genResult = rwUtils.inferenecRequest(genConfig)
# Debug: Print the response received
+8
View File
@@ -6,6 +6,9 @@ class imageInferenceInputs:
return {
"required": {},
"optional": {
"image": ("IMAGE", {
"tooltip": "Specifies an image input for the inference process."
}),
"Reference Image 1": ("IMAGE", {
"tooltip": "Specifies Reference Image 1 for the inputs. These reference images help guide the image generation process."
}),
@@ -28,6 +31,7 @@ class imageInferenceInputs:
CATEGORY = "Runware"
def createInputs(self, **kwargs):
image = kwargs.get("image", None)
refImage1 = kwargs.get("Reference Image 1", None)
refImage2 = kwargs.get("Reference Image 2", None)
refImage3 = kwargs.get("Reference Image 3", None)
@@ -36,6 +40,10 @@ class imageInferenceInputs:
# Build the inputs structure
inputs = {}
# Handle image if provided
if image is not None:
inputs["image"] = rwUtils.convertTensor2IMG(image)
# Handle references if any are provided
references = []
if refImage1 is not None:
File diff suppressed because one or more lines are too long