MCPcopy Create free account
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / saveWorkflow

Function saveWorkflow

web/js/workflows.js:60–79  ·  view source on GitHub ↗
(name, workflow, overwrite)

Source from the content-addressed store, hash-verified

58}
59
60async function saveWorkflow(name, workflow, overwrite) {
61 try {
62 const response = await api.fetchApi("/pysssss/workflows", {
63 method: "POST",
64 headers: {
65 "Content-Type": "application/json",
66 },
67 body: JSON.stringify({ name, workflow, overwrite }),
68 });
69 if (response.status === 201) {
70 return true;
71 }
72 if (response.status === 409) {
73 return false;
74 }
75 throw new Error(response.statusText);
76 } catch (error) {
77 console.error(error);
78 }
79}
80
81class PysssssWorkflows {
82 async load() {

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected