Skip to content

Commit b9def4c

Browse files
committed
refactor: remove preview_method and component legacy features
Preview Method Removal: - Remove preview method UI from Manager settings panel - Remove /v2/manager/preview_method API endpoint (legacy) - Remove set_preview_method() and get_current_preview_method() functions - Remove preview_method from config read/write operations - Clean up latent_preview imports Use ComfyUI Settings > Execution > Live preview method instead. Component Feature Removal: - Delete components-manager.js entirely - Remove ComponentBuilderDialog, load_components, set_component_policy - Remove component policy UI from Manager settings panel - Remove /v2/manager/policy/component API endpoint - Remove /v2/manager/component/save and /loads API endpoints - Remove component_policy from config read/write operations - Remove manager_components_path from context
1 parent a7eb93f commit b9def4c

File tree

9 files changed

+1
-1042
lines changed

9 files changed

+1
-1042
lines changed

comfyui_manager/common/context.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
manager_snapshot_path = None
3232
manager_pip_overrides_path = None
3333
manager_pip_blacklist_path = None
34-
manager_components_path = None
3534
manager_batch_history_path = None
3635

3736
def update_user_directory(manager_dir):
@@ -42,7 +41,6 @@ def update_user_directory(manager_dir):
4241
global manager_snapshot_path
4342
global manager_pip_overrides_path
4443
global manager_pip_blacklist_path
45-
global manager_components_path
4644
global manager_batch_history_path
4745

4846
manager_files_path = manager_dir
@@ -61,7 +59,6 @@ def update_user_directory(manager_dir):
6159
manager_channel_list_path = os.path.join(manager_files_path, 'channels.list')
6260
manager_pip_overrides_path = os.path.join(manager_files_path, "pip_overrides.json")
6361
manager_pip_blacklist_path = os.path.join(manager_files_path, "pip_blacklist.list")
64-
manager_components_path = os.path.join(manager_files_path, "components")
6562
manager_util.cache_dir = os.path.join(manager_files_path, "cache")
6663
manager_batch_history_path = os.path.join(manager_files_path, "batch_history")
6764

comfyui_manager/glob/manager_core.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,9 +1574,6 @@ class ManagerFuncs:
15741574
def __init__(self):
15751575
pass
15761576

1577-
def get_current_preview_method(self):
1578-
return "none"
1579-
15801577
def run_script(self, cmd, cwd='.'):
15811578
if len(cmd) > 0 and cmd[0].startswith("#"):
15821579
print(f"[ComfyUI-Manager] Unexpected behavior: `{cmd}`")
@@ -1594,14 +1591,12 @@ def write_config():
15941591
config = configparser.ConfigParser(strict=False)
15951592

15961593
config['default'] = {
1597-
'preview_method': manager_funcs.get_current_preview_method(),
15981594
'git_exe': get_config()['git_exe'],
15991595
'use_uv': get_config()['use_uv'],
16001596
'channel_url': get_config()['channel_url'],
16011597
'share_option': get_config()['share_option'],
16021598
'bypass_ssl': get_config()['bypass_ssl'],
16031599
"file_logging": get_config()['file_logging'],
1604-
'component_policy': get_config()['component_policy'],
16051600
'update_policy': get_config()['update_policy'],
16061601
'windows_selector_event_loop_policy': get_config()['windows_selector_event_loop_policy'],
16071602
'model_download_by_agent': get_config()['model_download_by_agent'],
@@ -1634,15 +1629,13 @@ def get_bool(key, default_value):
16341629

16351630
return {
16361631
'http_channel_enabled': get_bool('http_channel_enabled', False),
1637-
'preview_method': default_conf.get('preview_method', manager_funcs.get_current_preview_method()).lower(),
16381632
'git_exe': default_conf.get('git_exe', ''),
16391633
'use_uv': get_bool('use_uv', True),
16401634
'channel_url': default_conf.get('channel_url', DEFAULT_CHANNEL),
16411635
'default_cache_as_channel_url': get_bool('default_cache_as_channel_url', False),
16421636
'share_option': default_conf.get('share_option', 'all').lower(),
16431637
'bypass_ssl': get_bool('bypass_ssl', False),
16441638
'file_logging': get_bool('file_logging', True),
1645-
'component_policy': default_conf.get('component_policy', 'workflow').lower(),
16461639
'update_policy': default_conf.get('update_policy', 'stable-comfyui').lower(),
16471640
'windows_selector_event_loop_policy': get_bool('windows_selector_event_loop_policy', False),
16481641
'model_download_by_agent': get_bool('model_download_by_agent', False),
@@ -1661,15 +1654,13 @@ def get_bool(key, default_value):
16611654

16621655
return {
16631656
'http_channel_enabled': False,
1664-
'preview_method': manager_funcs.get_current_preview_method(),
16651657
'git_exe': '',
16661658
'use_uv': manager_util.use_uv,
16671659
'channel_url': DEFAULT_CHANNEL,
16681660
'default_cache_as_channel_url': False,
16691661
'share_option': 'all',
16701662
'bypass_ssl': manager_util.bypass_ssl,
16711663
'file_logging': True,
1672-
'component_policy': 'workflow',
16731664
'update_policy': 'stable-comfyui',
16741665
'windows_selector_event_loop_policy': False,
16751666
'model_download_by_agent': False,

comfyui_manager/glob/manager_server.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from comfyui_manager.common.timestamp_utils import get_timestamp_for_filename, get_now
2828

2929
import folder_paths
30-
import latent_preview
3130
import nodes
3231
from aiohttp import web
3332
from comfy.cli_args import args
@@ -131,16 +130,6 @@ def error_response(
131130

132131

133132
class ManagerFuncsInComfyUI(core.ManagerFuncs):
134-
def get_current_preview_method(self):
135-
if args.preview_method == latent_preview.LatentPreviewMethod.Auto:
136-
return "auto"
137-
elif args.preview_method == latent_preview.LatentPreviewMethod.Latent2RGB:
138-
return "latent2rgb"
139-
elif args.preview_method == latent_preview.LatentPreviewMethod.TAESD:
140-
return "taesd"
141-
else:
142-
return "none"
143-
144133
def run_script(self, cmd, cwd="."):
145134
if len(cmd) > 0 and cmd[0].startswith("#"):
146135
logging.error(f"[ComfyUI-Manager] Unexpected behavior: `{cmd}`")
@@ -704,8 +693,6 @@ def _get_cli_args(self) -> dict[str, Any]:
704693
cli_args["listen"] = args.listen
705694
if hasattr(args, "port"):
706695
cli_args["port"] = args.port
707-
if hasattr(args, "preview_method"):
708-
cli_args["preview_method"] = str(args.preview_method)
709696
if hasattr(args, "enable_manager_legacy_ui"):
710697
cli_args["enable_manager_legacy_ui"] = args.enable_manager_legacy_ui
711698
if hasattr(args, "front_end_version"):
@@ -819,14 +806,6 @@ def _cleanup_old_batches(self) -> None:
819806

820807
task_queue = TaskQueue()
821808

822-
# Preview method initialization
823-
if args.preview_method == latent_preview.LatentPreviewMethod.NoPreviews:
824-
environment_utils.set_preview_method(core.get_config()["preview_method"])
825-
else:
826-
logging.warning(
827-
"[ComfyUI-Manager] Since --preview-method is set, ComfyUI-Manager's preview method feature will be ignored."
828-
)
829-
830809

831810
async def task_worker():
832811
logging.debug("[ComfyUI-Manager] Task worker started")

comfyui_manager/glob/utils/environment_utils.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
from comfyui_manager.common import context
77
import folder_paths
8-
from comfy.cli_args import args
9-
import latent_preview
108

119
from comfyui_manager.glob import manager_core as core
1210
from comfyui_manager.common import cm_global
@@ -93,19 +91,6 @@ def print_comfyui_version():
9391
)
9492

9593

96-
def set_preview_method(method):
97-
if method == "auto":
98-
args.preview_method = latent_preview.LatentPreviewMethod.Auto
99-
elif method == "latent2rgb":
100-
args.preview_method = latent_preview.LatentPreviewMethod.Latent2RGB
101-
elif method == "taesd":
102-
args.preview_method = latent_preview.LatentPreviewMethod.TAESD
103-
else:
104-
args.preview_method = latent_preview.LatentPreviewMethod.NoPreviews
105-
106-
core.get_config()["preview_method"] = method
107-
108-
10994
def set_update_policy(mode):
11095
core.get_config()["update_policy"] = mode
11196

@@ -135,7 +120,6 @@ def initialize_environment():
135120
# manager_util.comfyui_manager_path, "extension-node-map.json"
136121
# )
137122

138-
set_preview_method(core.get_config()["preview_method"])
139123
print_comfyui_version()
140124
setup_environment()
141125

comfyui_manager/js/comfyui-manager.js

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
rebootAPI, setManagerInstance, show_message, customAlert, customPrompt,
1717
infoToast, showTerminal, setNeedRestart, generateUUID
1818
} from "./common.js";
19-
import { ComponentBuilderDialog, load_components, set_component_policy } from "./components-manager.js";
2019
import { CustomNodesManager } from "./custom-nodes-manager.js";
2120
import { ModelManager } from "./model-manager.js";
2221
import { SnapshotManager } from "./snapshot.js";
@@ -957,25 +956,6 @@ class ManagerMenuDialog extends ComfyDialog {
957956

958957
const dbRetrievalSetttingItem = createSettingsCombo("DB", this.datasrc_combo);
959958

960-
// preview method
961-
let preview_combo = document.createElement("select");
962-
preview_combo.setAttribute("title", "Configure how latent variables will be decoded during preview in the sampling process.");
963-
preview_combo.className = "cm-menu-combo p-select p-component p-inputwrapper p-inputwrapper-filled";
964-
preview_combo.appendChild($el('option', { value: 'auto', text: 'Auto' }, []));
965-
preview_combo.appendChild($el('option', { value: 'taesd', text: 'TAESD (slow)' }, []));
966-
preview_combo.appendChild($el('option', { value: 'latent2rgb', text: 'Latent2RGB (fast)' }, []));
967-
preview_combo.appendChild($el('option', { value: 'none', text: 'None (very fast)' }, []));
968-
969-
api.fetchApi('/v2/manager/preview_method')
970-
.then(response => response.text())
971-
.then(data => { preview_combo.value = data; });
972-
973-
preview_combo.addEventListener('change', function (event) {
974-
api.fetchApi(`/v2/manager/preview_method?value=${event.target.value}`);
975-
});
976-
977-
const previewSetttingItem = createSettingsCombo("Preview method", preview_combo);
978-
979959
// channel
980960
let channel_combo = document.createElement("select");
981961
channel_combo.setAttribute("title", "Configure the channel for retrieving data from the Custom Node list (including missing nodes) or the Model list.");
@@ -1044,26 +1024,6 @@ class ManagerMenuDialog extends ComfyDialog {
10441024

10451025
const shareSetttingItem = createSettingsCombo("Share", share_combo);
10461026

1047-
let component_policy_combo = document.createElement("select");
1048-
component_policy_combo.setAttribute("title", "When loading the workflow, configure which version of the component to use.");
1049-
component_policy_combo.className = "cm-menu-combo p-select p-component p-inputwrapper p-inputwrapper-filled";
1050-
component_policy_combo.appendChild($el('option', { value: 'workflow', text: 'Use workflow version' }, []));
1051-
component_policy_combo.appendChild($el('option', { value: 'higher', text: 'Use higher version' }, []));
1052-
component_policy_combo.appendChild($el('option', { value: 'mine', text: 'Use my version' }, []));
1053-
api.fetchApi('/v2/manager/policy/component')
1054-
.then(response => response.text())
1055-
.then(data => {
1056-
component_policy_combo.value = data;
1057-
set_component_policy(data);
1058-
});
1059-
1060-
component_policy_combo.addEventListener('change', function (event) {
1061-
api.fetchApi(`/v2/manager/policy/component?value=${event.target.value}`);
1062-
set_component_policy(event.target.value);
1063-
});
1064-
1065-
const componentSetttingItem = createSettingsCombo("Component", component_policy_combo);
1066-
10671027
update_policy_combo = document.createElement("select");
10681028

10691029
update_policy_combo.setAttribute("title", "Sets the policy to be applied when performing an update.");
@@ -1088,9 +1048,7 @@ class ManagerMenuDialog extends ComfyDialog {
10881048
return [
10891049
dbRetrievalSetttingItem,
10901050
channelSetttingItem,
1091-
previewSetttingItem,
10921051
shareSetttingItem,
1093-
componentSetttingItem,
10941052
updateSetttingItem,
10951053
//[TODO] replace mt-2 with wrapper div with flex column gap
10961054
$el("filedset.cm-experimental.mt-auto", {}, [
@@ -1430,14 +1388,6 @@ app.registerExtension({
14301388
});
14311389
},
14321390
async setup() {
1433-
let orig_clear = app.graph.clear;
1434-
app.graph.clear = function () {
1435-
orig_clear.call(app.graph);
1436-
load_components();
1437-
};
1438-
1439-
load_components();
1440-
14411391
const menu = document.querySelector(".comfy-menu");
14421392
const separator = document.createElement("hr");
14431393

@@ -1566,19 +1516,6 @@ app.registerExtension({
15661516
node.prototype.getExtraMenuOptions = function (_, options) {
15671517
origGetExtraMenuOptions?.apply?.(this, arguments);
15681518

1569-
if (node.category.startsWith('group nodes>')) {
1570-
options.push({
1571-
content: "Save As Component",
1572-
callback: (obj) => {
1573-
if (!ComponentBuilderDialog.instance) {
1574-
ComponentBuilderDialog.instance = new ComponentBuilderDialog();
1575-
}
1576-
ComponentBuilderDialog.instance.target_node = node;
1577-
ComponentBuilderDialog.instance.show();
1578-
}
1579-
}, null);
1580-
}
1581-
15821519
if (isOutputNode(node)) {
15831520
const { potential_outputs } = getPotentialOutputsAndOutputNodes([this]);
15841521
const hasOutput = potential_outputs.length > 0;

0 commit comments

Comments
 (0)