Fixed on comments and raising exceptions
This commit is contained in:
@@ -195,7 +195,7 @@ class txt2img:
|
||||
"tooltip": "Connect Runware Image Inference Ultralytics node to configure Ultralytics parameters (maskBlur, maskPadding, confidence, prompts, steps, CFGScale, strength).",
|
||||
}),
|
||||
"advancedFeatures": ("RUNWAREIMAGEINFERENCEADVANCEDFEATURES", {
|
||||
"tooltip": "Connect Runware Image Advanced Feature Input for layerDiffuse (transparency) and hiresFix (two-stage high-res).",
|
||||
"tooltip": "Connect Runware Image Advanced Feature Input to configure advancedFeatures: layerDiffuse (transparency), hiresFix (two-stage high-res), watermark, and regionalPrompting (per-region prompts and masks).",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class RunwareRegionalPromptingAdvancedFeature:
|
||||
}),
|
||||
"baseRatio": ("FLOAT", {
|
||||
"tooltip": "Base prompt attention weight (0.0 - 1.0).",
|
||||
"default": 0.0,
|
||||
"default": 0.2,
|
||||
"min": 0.0,
|
||||
"max": 1.0,
|
||||
"step": 0.01,
|
||||
|
||||
@@ -98,13 +98,21 @@ class RunwareWatermarkAdvancedFeature:
|
||||
has_text = use_text and bool(text)
|
||||
|
||||
image_str: str = ""
|
||||
if use_image and raw_image is not None:
|
||||
if use_image:
|
||||
if raw_image is None:
|
||||
raise Exception(
|
||||
"Watermark 'useImage' is enabled but no IMAGE input was provided. "
|
||||
"Connect an IMAGE (e.g., from a Load Image node) to the watermark node."
|
||||
)
|
||||
# If an IMAGE tensor is connected, convert it to a data URI / UUID.
|
||||
try:
|
||||
# convertTensor2IMG handles caching and returns either UUID or data URI.
|
||||
image_str = convertTensor2IMG(raw_image)
|
||||
except Exception:
|
||||
image_str = ""
|
||||
except Exception as e:
|
||||
raise Exception(
|
||||
f"Failed to convert watermark IMAGE input. "
|
||||
f"Ensure the connected image is valid. Details: {e}"
|
||||
) from e
|
||||
|
||||
has_image = use_image and bool(image_str)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user