feat: Add FLUX2 and RiverFlow2 workflow examples
This commit is contained in:
@@ -349,7 +349,19 @@ def inferenecRequest(genConfig):
|
||||
raise Exception("Error: Invalid JSON response from API!")
|
||||
if "errors" in genResult:
|
||||
print(f"[DEBUG] API Error Response: {safe_json_dumps(genResult, indent=2) if isinstance(genResult, dict) else genResult}")
|
||||
raise Exception(genResult["errors"][0]["message"])
|
||||
error_obj = genResult["errors"][0]
|
||||
error_message = error_obj.get("message", "Unknown error")
|
||||
|
||||
# Add allowedValues if present
|
||||
if "allowedValues" in error_obj:
|
||||
allowed_values = error_obj["allowedValues"]
|
||||
error_message += f"\n\nAllowed values:\n" + "\n".join(f" - {val}" for val in allowed_values)
|
||||
|
||||
# Add documentation link if present
|
||||
if "documentation" in error_obj:
|
||||
error_message += f"\n\nDocumentation: {error_obj['documentation']}"
|
||||
|
||||
raise Exception(error_message)
|
||||
else:
|
||||
return genResult
|
||||
except requests.exceptions.Timeout:
|
||||
|
||||
@@ -355,22 +355,8 @@ class txt2vid:
|
||||
|
||||
print(f"[Debugging] Generation config: {rwUtils.safe_json_dumps(genConfig, indent=2)}")
|
||||
except Exception as e:
|
||||
# Check if it's a dimension error and provide helpful information
|
||||
error_msg = str(e)
|
||||
if ("unsupported width" in error_msg.lower() or
|
||||
"unsupported height" in error_msg.lower() or
|
||||
"invalid width" in error_msg.lower() or
|
||||
"invalid height" in error_msg.lower() or
|
||||
"dimension not supported" in error_msg.lower()):
|
||||
# Get model default dimensions for comparison
|
||||
modelDimensions = videoModelSearch.MODEL_DIMENSIONS.get(model, {"width": 1024, "height": 576})
|
||||
expectedWidth = modelDimensions["width"]
|
||||
expectedHeight = modelDimensions["height"]
|
||||
|
||||
raise Exception(f"Error: Unsupported width/height combination for this model architecture. You used {width}x{height}, but {model} expects {expectedWidth}x{expectedHeight}. Please use 'Model Default' or set custom dimensions to {expectedWidth}x{expectedHeight}.")
|
||||
else:
|
||||
# Re-raise the original error
|
||||
raise e
|
||||
# Re-raise the original error without modification
|
||||
raise e
|
||||
|
||||
# Extract task UUID for polling
|
||||
taskUUID = genConfig[0]["taskUUID"]
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user