Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f1ebbf84 |
@@ -2995,7 +2995,6 @@ async def create_workflow_proxy(request):
|
|||||||
name = data.get("name")
|
name = data.get("name")
|
||||||
workflow_json = data.get("workflow_json")
|
workflow_json = data.get("workflow_json")
|
||||||
workflow_api = data.get("workflow_api")
|
workflow_api = data.get("workflow_api")
|
||||||
machine_id = data.get("machine_id")
|
|
||||||
api_url = data.get("api_url", "https://api.comfydeploy.com")
|
api_url = data.get("api_url", "https://api.comfydeploy.com")
|
||||||
|
|
||||||
auth_header = request.headers.get("Authorization")
|
auth_header = request.headers.get("Authorization")
|
||||||
@@ -3015,7 +3014,6 @@ async def create_workflow_proxy(request):
|
|||||||
"name": name,
|
"name": name,
|
||||||
"workflow_json": json.dumps(workflow_json),
|
"workflow_json": json.dumps(workflow_json),
|
||||||
"workflow_api": json.dumps(workflow_api),
|
"workflow_api": json.dumps(workflow_api),
|
||||||
"machine_id": machine_id,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -3138,147 +3136,3 @@ async def get_workflow_proxy(request):
|
|||||||
return web.json_response(json_data, status=response.status)
|
return web.json_response(json_data, status=response.status)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return web.json_response({"error": str(e)}, status=500)
|
return web.json_response({"error": str(e)}, status=500)
|
||||||
|
|
||||||
|
|
||||||
# for getting a machine by id
|
|
||||||
@server.PromptServer.instance.routes.get("/comfyui-deploy/machine")
|
|
||||||
async def get_machine_proxy(request):
|
|
||||||
machine_id = request.rel_url.query.get("machine_id")
|
|
||||||
api_url = request.rel_url.query.get("api_url", "https://api.comfydeploy.com")
|
|
||||||
auth_header = request.headers.get("Authorization")
|
|
||||||
|
|
||||||
if not auth_header:
|
|
||||||
return web.json_response(
|
|
||||||
{"error": "Authorization header is required"}, status=401
|
|
||||||
)
|
|
||||||
|
|
||||||
target_url = f"{api_url}/api/machine/{machine_id}"
|
|
||||||
|
|
||||||
try:
|
|
||||||
await ensure_client_session()
|
|
||||||
async with client_session.get(
|
|
||||||
target_url, headers={"Authorization": auth_header}
|
|
||||||
) as response:
|
|
||||||
json_data = await response.json()
|
|
||||||
return web.json_response(json_data, status=response.status)
|
|
||||||
except Exception as e:
|
|
||||||
return web.json_response({"error": str(e)}, status=500)
|
|
||||||
|
|
||||||
|
|
||||||
# for fetching docker steps from current snapshot
|
|
||||||
@server.PromptServer.instance.routes.post("/comfyui-deploy/snapshot-to-docker")
|
|
||||||
async def snapshot_to_docker_proxy(request):
|
|
||||||
data = await request.json()
|
|
||||||
snapshot = data.get("snapshot")
|
|
||||||
api_url = data.get("api_url", "https://api.comfydeploy.com")
|
|
||||||
auth_header = request.headers.get("Authorization")
|
|
||||||
|
|
||||||
if not auth_header:
|
|
||||||
return web.json_response(
|
|
||||||
{"error": "Authorization header is required"}, status=401
|
|
||||||
)
|
|
||||||
|
|
||||||
target_url = f"{api_url}/api/snapshot-to-docker"
|
|
||||||
|
|
||||||
request_body = snapshot
|
|
||||||
|
|
||||||
try:
|
|
||||||
await ensure_client_session()
|
|
||||||
async with client_session.post(
|
|
||||||
target_url, json=request_body, headers={"Authorization": auth_header}
|
|
||||||
) as response:
|
|
||||||
json_data = await response.json()
|
|
||||||
return web.json_response(json_data, status=response.status)
|
|
||||||
except Exception as e:
|
|
||||||
return web.json_response({"error": str(e)}, status=500)
|
|
||||||
|
|
||||||
|
|
||||||
# update a serverless machine with machine id
|
|
||||||
@server.PromptServer.instance.routes.post("/comfyui-deploy/machine/update")
|
|
||||||
async def update_machine_proxy(request):
|
|
||||||
data = await request.json()
|
|
||||||
machine_id = data.get("machine_id")
|
|
||||||
comfyui_version = data.get("comfyui_version", None)
|
|
||||||
docker_steps = data.get("docker_steps")
|
|
||||||
api_url = data.get("api_url", "https://api.comfydeploy.com")
|
|
||||||
auth_header = request.headers.get("Authorization")
|
|
||||||
|
|
||||||
if not auth_header:
|
|
||||||
return web.json_response(
|
|
||||||
{"error": "Authorization header is required"}, status=401
|
|
||||||
)
|
|
||||||
|
|
||||||
target_url = f"{api_url}/api/machine/serverless/{machine_id}"
|
|
||||||
|
|
||||||
request_body = {"docker_command_steps": docker_steps}
|
|
||||||
|
|
||||||
if comfyui_version:
|
|
||||||
request_body["comfyui_version"] = comfyui_version
|
|
||||||
|
|
||||||
try:
|
|
||||||
await ensure_client_session()
|
|
||||||
async with client_session.patch(
|
|
||||||
target_url, json=request_body, headers={"Authorization": auth_header}
|
|
||||||
) as response:
|
|
||||||
json_data = await response.json()
|
|
||||||
return web.json_response(json_data, status=response.status)
|
|
||||||
except Exception as e:
|
|
||||||
return web.json_response({"error": str(e)}, status=500)
|
|
||||||
|
|
||||||
|
|
||||||
@server.PromptServer.instance.routes.post("/comfyui-deploy/machine/create")
|
|
||||||
async def create_machine_proxy(request):
|
|
||||||
data = await request.json()
|
|
||||||
name = data.get("name")
|
|
||||||
docker_command_steps = data.get("docker_command_steps")
|
|
||||||
comfyui_version = data.get("comfyui_version")
|
|
||||||
api_url = data.get("api_url", "https://api.comfydeploy.com")
|
|
||||||
auth_header = request.headers.get("Authorization")
|
|
||||||
|
|
||||||
if not auth_header:
|
|
||||||
return web.json_response(
|
|
||||||
{"error": "Authorization header is required"}, status=401
|
|
||||||
)
|
|
||||||
|
|
||||||
target_url = f"{api_url}/api/machine/serverless"
|
|
||||||
|
|
||||||
request_body = {
|
|
||||||
"name": name,
|
|
||||||
"docker_command_steps": docker_command_steps,
|
|
||||||
"comfyui_version": comfyui_version,
|
|
||||||
"gpu": "A10G",
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
|
||||||
await ensure_client_session()
|
|
||||||
async with client_session.post(
|
|
||||||
target_url, json=request_body, headers={"Authorization": auth_header}
|
|
||||||
) as response:
|
|
||||||
json_data = await response.json()
|
|
||||||
return web.json_response(json_data, status=response.status)
|
|
||||||
except Exception as e:
|
|
||||||
return web.json_response({"error": str(e)}, status=500)
|
|
||||||
|
|
||||||
|
|
||||||
# get latest comfyui version
|
|
||||||
@server.PromptServer.instance.routes.get("/comfyui-deploy/comfyui-version")
|
|
||||||
async def get_comfyui_version_proxy(request):
|
|
||||||
api_url = request.rel_url.query.get("api_url", "https://api.comfydeploy.com")
|
|
||||||
auth_header = request.headers.get("Authorization")
|
|
||||||
|
|
||||||
if not auth_header:
|
|
||||||
return web.json_response(
|
|
||||||
{"error": "Authorization header is required"}, status=401
|
|
||||||
)
|
|
||||||
|
|
||||||
target_url = f"{api_url}/api/latest-hashes"
|
|
||||||
|
|
||||||
try:
|
|
||||||
await ensure_client_session()
|
|
||||||
async with client_session.get(
|
|
||||||
target_url, headers={"Authorization": auth_header}
|
|
||||||
) as response:
|
|
||||||
json_data = await response.json()
|
|
||||||
return web.json_response(json_data, status=response.status)
|
|
||||||
except Exception as e:
|
|
||||||
return web.json_response({"error": str(e)}, status=500)
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "comfyui-deploy"
|
name = "comfyui-deploy"
|
||||||
description = "Open source comfyui deployment platform, a vercel for generative workflow infra."
|
description = "Open source comfyui deployment platform, a vercel for generative workflow infra."
|
||||||
version = "2.3.0"
|
version = "2.2.1"
|
||||||
license = { file = "LICENSE" }
|
license = { file = "LICENSE" }
|
||||||
dependencies = ["aiofiles", "pydantic", "opencv-python", "imageio-ffmpeg", "tabulate", "brotli"]
|
dependencies = ["aiofiles", "pydantic", "opencv-python", "imageio-ffmpeg", "tabulate", "brotli"]
|
||||||
|
|
||||||
|
|||||||
+143
-17
@@ -4,8 +4,6 @@ import { api } from "../../scripts/api.js";
|
|||||||
LGraphNode = LiteGraph.LGraphNode;
|
LGraphNode = LiteGraph.LGraphNode;
|
||||||
import { ComfyDialog, $el } from "../../scripts/ui.js";
|
import { ComfyDialog, $el } from "../../scripts/ui.js";
|
||||||
import { initializeWorkflowsList, addWorkflowSearch } from "./workflow-list.js";
|
import { initializeWorkflowsList, addWorkflowSearch } from "./workflow-list.js";
|
||||||
import { initializeMachineManager } from "./machine-manager.js";
|
|
||||||
import { fetchSnapshotSimple } from "./snapshot-utils.js";
|
|
||||||
|
|
||||||
import { generateDependencyGraph } from "https://esm.sh/comfyui-json@0.1.25";
|
import { generateDependencyGraph } from "https://esm.sh/comfyui-json@0.1.25";
|
||||||
// import { ComfyDeploy } from "https://esm.sh/comfydeploy@2.0.0-beta.69";
|
// import { ComfyDeploy } from "https://esm.sh/comfydeploy@2.0.0-beta.69";
|
||||||
@@ -1173,12 +1171,24 @@ async function deployWorkflow() {
|
|||||||
<br>
|
<br>
|
||||||
<button style="font-size: 18px;">${endpoint}</button>
|
<button style="font-size: 18px;">${endpoint}</button>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
<label>
|
||||||
|
<input id="include-deps" type="checkbox">Include dependency</input>
|
||||||
|
</label>
|
||||||
|
<br>
|
||||||
|
<label>
|
||||||
|
<input id="reuse-hash" type="checkbox" checked>Reuse hash from last version</input>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
if (!ok) return;
|
if (!ok) return;
|
||||||
|
|
||||||
|
const includeDeps = document.getElementById("include-deps").checked;
|
||||||
|
const reuseHash = document.getElementById("reuse-hash").checked;
|
||||||
|
|
||||||
const prompt = await app.graphToPrompt();
|
const prompt = await app.graphToPrompt();
|
||||||
|
let deps = undefined;
|
||||||
|
|
||||||
console.log(prompt);
|
console.log(prompt);
|
||||||
|
|
||||||
@@ -1234,7 +1244,7 @@ async function deployWorkflow() {
|
|||||||
}
|
}
|
||||||
loadingDialog.showLoading("Generating snapshot");
|
loadingDialog.showLoading("Generating snapshot");
|
||||||
|
|
||||||
const snapshot = await fetchSnapshotSimple();
|
const snapshot = await fetch("/snapshot/get_current").then((x) => x.json());
|
||||||
console.log(snapshot);
|
console.log(snapshot);
|
||||||
loadingDialog.close();
|
loadingDialog.close();
|
||||||
|
|
||||||
@@ -1248,6 +1258,136 @@ async function deployWorkflow() {
|
|||||||
|
|
||||||
const title = deploy.querySelector("#button-title");
|
const title = deploy.querySelector("#button-title");
|
||||||
|
|
||||||
|
if (includeDeps) {
|
||||||
|
loadingDialog.showLoading("Fetching existing version");
|
||||||
|
|
||||||
|
const existing_workflow = await fetch(
|
||||||
|
apiUrl + "/api/workflow/" + workflow_id,
|
||||||
|
{
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: "Bearer " + apiKey,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then((x) => x.json())
|
||||||
|
.catch(() => {
|
||||||
|
return {};
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("workflow", existing_workflow);
|
||||||
|
|
||||||
|
loadingDialog.close();
|
||||||
|
|
||||||
|
loadingDialog.showLoading("Generating dependency graph");
|
||||||
|
deps = await generateDependencyGraph({
|
||||||
|
workflow_api: prompt.output,
|
||||||
|
snapshot: snapshot,
|
||||||
|
computeFileHash: async (file) => {
|
||||||
|
console.log(existing_workflow?.dependencies?.models);
|
||||||
|
|
||||||
|
// Match previous hash for models
|
||||||
|
if (reuseHash && existing_workflow?.dependencies?.models) {
|
||||||
|
const previousModelHash = Object.entries(
|
||||||
|
existing_workflow?.dependencies?.models
|
||||||
|
).flatMap(([key, value]) => {
|
||||||
|
return Object.values(value).map((x) => ({
|
||||||
|
...x,
|
||||||
|
name: "models/" + key + "/" + x.name,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
console.log(previousModelHash);
|
||||||
|
|
||||||
|
const match = previousModelHash.find((x) => {
|
||||||
|
console.log(file, x.name);
|
||||||
|
return file == x.name;
|
||||||
|
});
|
||||||
|
console.log(match);
|
||||||
|
if (match && match.hash) {
|
||||||
|
console.log("cached hash used");
|
||||||
|
return match.hash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(file);
|
||||||
|
loadingDialog.showLoading("Generating hash", file);
|
||||||
|
const hash = await fetch(
|
||||||
|
`/comfyui-deploy/get-file-hash?file_path=${encodeURIComponent(file)}`
|
||||||
|
).then((x) => x.json());
|
||||||
|
loadingDialog.showLoading("Generating hash", file);
|
||||||
|
console.log(hash);
|
||||||
|
return hash.file_hash;
|
||||||
|
},
|
||||||
|
// handleFileUpload: async (file, hash, prevhash) => {
|
||||||
|
// console.log("Uploading ", file);
|
||||||
|
// loadingDialog.showLoading("Uploading file", file);
|
||||||
|
// try {
|
||||||
|
// const { download_url } = await fetch(`/comfyui-deploy/upload-file`, {
|
||||||
|
// method: "POST",
|
||||||
|
// body: JSON.stringify({
|
||||||
|
// file_path: file,
|
||||||
|
// token: apiKey,
|
||||||
|
// url: endpoint + "/api/upload-url",
|
||||||
|
// }),
|
||||||
|
// })
|
||||||
|
// .then((x) => x.json())
|
||||||
|
// .catch(() => {
|
||||||
|
// loadingDialog.close();
|
||||||
|
// confirmDialog.confirm("Error", "Unable to upload file " + file);
|
||||||
|
// });
|
||||||
|
// loadingDialog.showLoading("Uploaded file", file);
|
||||||
|
// console.log(download_url);
|
||||||
|
// return download_url;
|
||||||
|
// } catch (error) {
|
||||||
|
// return undefined;
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
existingDependencies: existing_workflow.dependencies,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Need to find a way to include this if this is not included in comfyui-json level
|
||||||
|
if (
|
||||||
|
!deps.custom_nodes["https://github.com/BennyKok/comfyui-deploy"] &&
|
||||||
|
!deps.custom_nodes["https://github.com/BennyKok/comfyui-deploy.git"]
|
||||||
|
)
|
||||||
|
deps.custom_nodes["https://github.com/BennyKok/comfyui-deploy"] = {
|
||||||
|
url: "https://github.com/BennyKok/comfyui-deploy",
|
||||||
|
install_type: "git-clone",
|
||||||
|
hash:
|
||||||
|
snapshot?.git_custom_nodes?.[
|
||||||
|
"https://github.com/BennyKok/comfyui-deploy"
|
||||||
|
]?.hash ?? "HEAD",
|
||||||
|
name: "ComfyUI Deploy",
|
||||||
|
};
|
||||||
|
|
||||||
|
loadingDialog.close();
|
||||||
|
console.log(deps);
|
||||||
|
|
||||||
|
const depsOk = await confirmDialog.confirm(
|
||||||
|
"Check dependencies",
|
||||||
|
// JSON.stringify(deps, null, 2),
|
||||||
|
`
|
||||||
|
<div>
|
||||||
|
You will need to create a cloud machine with the following configuration on ComfyDeploy
|
||||||
|
<ol style="text-align: left; margin-top: 10px;">
|
||||||
|
<li>Review the dependencies listed in the graph below</li>
|
||||||
|
<li>Create a new cloud machine with the required configuration</li>
|
||||||
|
<li>Install missing models and check missing files</li>
|
||||||
|
<li>Deploy your workflow to the newly created machine</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">${loadingIcon}</div>
|
||||||
|
<iframe
|
||||||
|
style="z-index: 10; min-width: 600px; max-width: 1024px; min-height: 600px; border: none; background-color: transparent;"
|
||||||
|
src="https://www.comfydeploy.com/dependency-graph?deps=${encodeURIComponent(
|
||||||
|
JSON.stringify(deps)
|
||||||
|
)}" />`
|
||||||
|
// createDynamicUIHtml(deps),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!depsOk) return;
|
||||||
|
}
|
||||||
|
|
||||||
loadingDialog.showLoading("Deploying...");
|
loadingDialog.showLoading("Deploying...");
|
||||||
|
|
||||||
title.innerText = "Deploying...";
|
title.innerText = "Deploying...";
|
||||||
@@ -1260,10 +1400,6 @@ async function deployWorkflow() {
|
|||||||
workflow_api: prompt.output,
|
workflow_api: prompt.output,
|
||||||
api_url: apiUrl,
|
api_url: apiUrl,
|
||||||
};
|
};
|
||||||
const machineId = localStorage.getItem("comfy_deploy_machine_id");
|
|
||||||
if (machineId) {
|
|
||||||
body.machine_id = machineId;
|
|
||||||
}
|
|
||||||
console.log(body);
|
console.log(body);
|
||||||
let data = await fetch("/comfyui-deploy/workflow", {
|
let data = await fetch("/comfyui-deploy/workflow", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -1882,13 +2018,6 @@ if (!isComfyDeployDashboard) {
|
|||||||
<div style="padding: 20px;">
|
<div style="padding: 20px;">
|
||||||
<h3>Comfy Deploy</h3>
|
<h3>Comfy Deploy</h3>
|
||||||
<div id="deploy-container" style="margin-bottom: 20px;"></div>
|
<div id="deploy-container" style="margin-bottom: 20px;"></div>
|
||||||
<div id="machine-container" style="margin-bottom: 20px;">
|
|
||||||
<h4>Serverless Machine</h4>
|
|
||||||
<div id="machine-loading" style="display: flex; justify-content: center; align-items: center; height: 100px;">
|
|
||||||
${loadingIcon}
|
|
||||||
</div>
|
|
||||||
<ul id="machine-list" style="list-style-type: none; padding: 0; display: none;"></ul>
|
|
||||||
</div>
|
|
||||||
<div id="workflows-container" style="display: none;">
|
<div id="workflows-container" style="display: none;">
|
||||||
<h4>Your Workflows</h4>
|
<h4>Your Workflows</h4>
|
||||||
<div id="workflows-loading" style="display: flex; justify-content: center; align-items: center; height: 100px;">
|
<div id="workflows-loading" style="display: flex; justify-content: center; align-items: center; height: 100px;">
|
||||||
@@ -1949,9 +2078,6 @@ if (!isComfyDeployDashboard) {
|
|||||||
const workflowsList = el.querySelector("#workflows-list");
|
const workflowsList = el.querySelector("#workflows-list");
|
||||||
const workflowsLoading = el.querySelector("#workflows-loading");
|
const workflowsLoading = el.querySelector("#workflows-loading");
|
||||||
|
|
||||||
// Initialize machine manager
|
|
||||||
await initializeMachineManager(el, getData);
|
|
||||||
|
|
||||||
// Initialize workflows list and search
|
// Initialize workflows list and search
|
||||||
const data = getData();
|
const data = getData();
|
||||||
if (data.apiKey) {
|
if (data.apiKey) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,82 +0,0 @@
|
|||||||
// Snapshot Utilities
|
|
||||||
// Centralized snapshot fetching with ComfyUI version fallback
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetches the current snapshot with ComfyUI version fallback
|
|
||||||
* If the snapshot response has null comfyui field, it will fetch the latest ComfyUI version
|
|
||||||
* and update the snapshot with the comfyui_hash
|
|
||||||
*
|
|
||||||
* @param {Function} getDataFn - Function that returns { apiKey, apiUrl } for ComfyUI version API calls
|
|
||||||
* @returns {Promise<Object>} - The snapshot data with comfyui field populated
|
|
||||||
*/
|
|
||||||
export async function fetchSnapshot(getDataFn = null) {
|
|
||||||
try {
|
|
||||||
// Fetch the current snapshot
|
|
||||||
const response = await fetch("/snapshot/get_current");
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`Snapshot fetch failed: ${response.status}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const snapshot = await response.json();
|
|
||||||
|
|
||||||
// Check if comfyui field is null and we have getDataFn for fallback
|
|
||||||
if (snapshot.comfyui === null && getDataFn) {
|
|
||||||
console.log(
|
|
||||||
"ComfyUI version is null in snapshot, fetching latest version..."
|
|
||||||
);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const data = getDataFn();
|
|
||||||
if (data && data.apiKey) {
|
|
||||||
const comfyuiVersionResponse = await fetch(
|
|
||||||
`/comfyui-deploy/comfyui-version?api_url=${encodeURIComponent(
|
|
||||||
data.apiUrl || "https://api.comfydeploy.com"
|
|
||||||
)}`,
|
|
||||||
{
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${data.apiKey}`,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (comfyuiVersionResponse.ok) {
|
|
||||||
const versionData = await comfyuiVersionResponse.json();
|
|
||||||
if (versionData.comfyui_hash) {
|
|
||||||
console.log(
|
|
||||||
`Using ComfyUI hash from API: ${versionData.comfyui_hash}`
|
|
||||||
);
|
|
||||||
snapshot.comfyui = versionData.comfyui_hash;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.warn(
|
|
||||||
"Failed to fetch ComfyUI version from API:",
|
|
||||||
comfyuiVersionResponse.status
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.warn("Error fetching ComfyUI version fallback:", error);
|
|
||||||
// Continue with original snapshot even if fallback fails
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return snapshot;
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error fetching snapshot:", error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Simple snapshot fetch without ComfyUI version fallback
|
|
||||||
* Use this when you don't need the ComfyUI version fallback logic
|
|
||||||
*
|
|
||||||
* @returns {Promise<Object>} - The snapshot data as-is
|
|
||||||
*/
|
|
||||||
export async function fetchSnapshotSimple() {
|
|
||||||
const response = await fetch("/snapshot/get_current");
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`Snapshot fetch failed: ${response.status}`);
|
|
||||||
}
|
|
||||||
return response.json();
|
|
||||||
}
|
|
||||||
@@ -279,7 +279,7 @@ async function initializeWorkflowsList(element, getData, getTimeAgo) {
|
|||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: calc(100vh - 550px);
|
height: calc(100vh - 350px);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
scrollbar-color: #666 transparent;
|
scrollbar-color: #666 transparent;
|
||||||
|
|||||||
Reference in New Issue
Block a user