Skip to content

suggestion: custom continue button text #5

Description

@chris87423

Hi!

I have made a little change that the continue button can have a custom name via the properties panel, it would be a nice addition if you could add this to your node.


async nodeCreated(node, app) {
        if (node.comfyClass === 'Pause') {
            if (!app.extensionManager.setting.get('AsyncPause.ForcePauseToggle')) {
                const force_pause_widget = node.widgets?.find((w) => w.name === 'force_pause');
                node.removeWidget(force_pause_widget);
            }
			
			// Start New Code
			
			node.properties = node.properties || {};
			if (!("pause_button_name" in node.properties)) node.properties.pause_button_name = "continue";
			const pause_button_name = (node.properties.pause_button_name || "continue")
			
			node.onPropertyChanged = function(name, value) {
				if (name === "pause_button_name") {
					const newLabel = value || "continue";

					if (this._pauseButtonEl) {
						this._pauseButtonEl.textContent = newLabel;
					}

					this.setDirtyCanvas(true, true);
				}
			};
					
            const dom_flashing_btn = createFlashingButton();
            const w = node.addDOMWidget('continue', 'custom', dom_flashing_btn);
			node._pauseButtonEl = dom_flashing_btn;
			
			// End New Code
			
			w.computeSize = () => [node.size[0], 34];
			w.serialize = false;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions