Fix Bria model CFGScale validation and add image parameter to inference inputs
- Cast CFGScale to int for Bria models to fix API validation error (Bria requires integer, not float) - Add 'image' parameter to Runware Image Inference Inputs node - Fix CFGScale handling to properly validate and format for Bria models - Add workflow file for Bria Fibo image inference
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -113,7 +113,7 @@ def getCustomEndpoint():
|
||||
custom_endpoint = os.getenv("RUNWARE_CUSTOM_ENDPOINT")
|
||||
if custom_endpoint and isinstance(custom_endpoint, str):
|
||||
return custom_endpoint
|
||||
return "https://api.runware.ai/v1"
|
||||
return "https://api.runware.dev/v1"
|
||||
|
||||
SESSION_TIMEOUT = getTimeout()
|
||||
RUNWARE_API_KEY = getAPIKey()
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user