Skip replacement if there is no replace function on the value. ...

Came across a workflow that was feeding an int 6 in here.
Workflow in question at
https://civitai.com/models/119528/sdxl-10-comfyui-ultimate-workflow,
v3.1.
This commit is contained in:
Jeff Cook
2023-08-19 22:57:39 -06:00
parent 32c9381c9e
commit 4237eb4aa8
+1 -1
View File
@@ -182,7 +182,7 @@ app.registerExtension({
const callbacks = [
() => {
let prompt = widget.value;
if (replaceRegex) {
if (replaceRegex && typeof prompt.replace !== 'undefined') {
prompt = prompt.replace(replaceRegex, (match, p1, p2, index, text, groups) => {
if (!groups.replace || !groups.id) return match; // No match, bad regex?