mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 08:30:06 +00:00
S&R improved filename sanitizing (#2784)
Co-authored-by: typpos <28550406+typpos@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// @ts-strict-ignore
|
||||
import { applyTextReplacements } from '@/utils/searchAndReplace'
|
||||
|
||||
import { app } from '../../scripts/app'
|
||||
import { applyTextReplacements } from '../../scripts/utils'
|
||||
|
||||
// Use widget values and dates in output filenames
|
||||
|
||||
@@ -21,7 +22,7 @@ app.registerExtension({
|
||||
|
||||
const widget = this.widgets.find((w) => w.name === 'filename_prefix')
|
||||
widget.serializeValue = () => {
|
||||
return applyTextReplacements(app, widget.value)
|
||||
return applyTextReplacements(app.graph.nodes, widget.value)
|
||||
}
|
||||
|
||||
return r
|
||||
|
||||
@@ -14,10 +14,11 @@ import type { CanvasMouseEvent } from '@comfyorg/litegraph/dist/types/events'
|
||||
|
||||
import type { InputSpec } from '@/schemas/nodeDefSchema'
|
||||
import { app } from '@/scripts/app'
|
||||
import { applyTextReplacements, clone } from '@/scripts/utils'
|
||||
import { clone } from '@/scripts/utils'
|
||||
import { ComfyWidgets, addValueControlWidgets } from '@/scripts/widgets'
|
||||
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import { applyTextReplacements } from '@/utils/searchAndReplace'
|
||||
import { isPrimitiveNode } from '@/utils/typeGuardUtil'
|
||||
|
||||
const CONVERTED_TYPE = 'converted-widget'
|
||||
@@ -73,7 +74,7 @@ export class PrimitiveNode extends LGraphNode {
|
||||
]
|
||||
let v = this.widgets?.[0].value
|
||||
if (v && this.properties[replacePropertyName]) {
|
||||
v = applyTextReplacements(app, v as string)
|
||||
v = applyTextReplacements(app.graph.nodes, v as string)
|
||||
}
|
||||
|
||||
// For each output link copy our value over the original widget value
|
||||
|
||||
Reference in New Issue
Block a user