comfyui-node

Acc. G-14 · v1.12.0

Migration Guide (v1.0)

Guide for upgrading from <1.0 to 1.0+ with complete deprecated API mappings.

Overview

Version 1.0.0 removed all legacy ComfyApi instance methods after a deprecation window in 0.2.x. All functionality has been moved to modular api.ext.* namespaces.

No runtime warnings remain – they were stripped with the removals.

Quick Migration Table

Deprecated MethodReplacement
queuePrompt(...)api.ext.queue.queuePrompt(...)
appendPrompt(...)api.ext.queue.appendPrompt(...)
getHistories(...)api.ext.history.getHistories(...)
getHistory(id)api.ext.history.getHistory(id)
getSystemStats()api.ext.system.getSystemStats()
getCheckpoints()api.ext.node.getCheckpoints()
getLoras()api.ext.node.getLoras()
getSamplerInfo()api.ext.node.getSamplerInfo()
getNodeDefs(name?)api.ext.node.getNodeDefs(name?)
getExtensions()api.ext.misc.getExtensions()
getEmbeddings()api.ext.misc.getEmbeddings()
uploadImage(...)api.ext.file.uploadImage(...)
uploadMask(...)api.ext.file.uploadMask(...)
getPathImage(info)api.ext.file.getPathImage(info)
getImage(info)api.ext.file.getImage(info)
getUserData(file)api.ext.file.getUserData(file)
storeUserData(...)api.ext.file.storeUserData(...)
deleteUserData(file)api.ext.file.deleteUserData(file)
moveUserData(...)api.ext.file.moveUserData(...)
listUserData(...)api.ext.file.listUserData(...)
getUserConfig()api.ext.user.getUserConfig()
createUser(name)api.ext.user.createUser(name)
getSettings()api.ext.user.getSettings()
getSetting(id)api.ext.user.getSetting(id)
storeSettings(map)api.ext.user.storeSettings(map)
storeSetting(id,val)api.ext.user.storeSetting(id,val)
getTerminalLogs()api.ext.terminal.getTerminalLogs()
setTerminalSubscription()api.ext.terminal.setTerminalSubscription()
interrupt()api.ext.queue.interrupt()

Migration Examples

Before (0.x)

ts
const stats = await api.getSystemStats();
await api.uploadImage(buf, 'a.png');
const checkpoints = await api.getCheckpoints();
const history = await api.getHistory('prompt-123');
await api.interrupt();

After (1.0+)

ts
const stats = await api.ext.system.getSystemStats();
await api.ext.file.uploadImage(buf, 'a.png');
const checkpoints = await api.ext.node.getCheckpoints();
const history = await api.ext.history.getHistory('prompt-123');
await api.ext.queue.interrupt();

Automated Migration

Bash (Unix/macOS)

bash
# Example for getSystemStats
grep -R "api\.getSystemStats" -n src | cut -d: -f1 | xargs sed -i '' 's/api\.getSystemStats()/api.ext.system.getSystemStats()/g'

# Repeat for each method, or use a sed script file

PowerShell (Windows)

powershell
Get-ChildItem -Recurse -Include *.ts | ForEach-Object {
  (Get-Content $_.FullName) -replace 'api\.getSystemStats\(\)', 'api.ext.system.getSystemStats()' | Set-Content $_.FullName
}

# Add similar lines for each deprecated method

Using Codemod Tools

For large codebases, consider tools like:

Benefits of Modular Namespaces

  • Better organization – Related functionality grouped together
  • Tree-shaking – Unused features can be eliminated by bundlers
  • Discoverability – IDE autocomplete shows available features per namespace
  • Extensibility – Easier to add new feature modules without polluting main API surface

Namespace Overview

NamespaceResponsibility
queuePrompt submission, append & interrupt
historyExecution history retrieval
systemSystem stats & memory free
nodeNode defs + sampler/checkpoint/lora helpers
userUser & settings CRUD
fileUploads, image helpers, user data file ops
modelExperimental model browsing & previews
terminalTerminal logs & subscription toggle
miscExtensions list, embeddings
managerComfyUI Manager extension integration
monitorCrystools monitor events & snapshot
featureFlagsServer capabilities (/features)

Still Need Help?

Acc. G-14 · Edit docs/migration-guide.md on GitHub