Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4df9d38e56 | ||
|
|
9cd626e1f6 |
+42
-13
@@ -59,7 +59,7 @@ print(f"max_retries: {max_retries}, retry_delay_multiplier: {retry_delay_multipl
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
async def async_request_with_retry(method, url, disable_timeout=False, **kwargs):
|
async def async_request_with_retry(method, url, disable_timeout=False, token=None, **kwargs):
|
||||||
global client_session
|
global client_session
|
||||||
await ensure_client_session()
|
await ensure_client_session()
|
||||||
retry_delay = 1 # Start with 1 second delay
|
retry_delay = 1 # Start with 1 second delay
|
||||||
@@ -72,6 +72,11 @@ async def async_request_with_retry(method, url, disable_timeout=False, **kwargs)
|
|||||||
timeout = ClientTimeout(total=None, connect=initial_timeout)
|
timeout = ClientTimeout(total=None, connect=initial_timeout)
|
||||||
kwargs['timeout'] = timeout
|
kwargs['timeout'] = timeout
|
||||||
|
|
||||||
|
if token is not None:
|
||||||
|
if 'headers' not in kwargs:
|
||||||
|
kwargs['headers'] = {}
|
||||||
|
kwargs['headers']['Authorization'] = f"Bearer {token}"
|
||||||
|
|
||||||
request_start = time.time()
|
request_start = time.time()
|
||||||
async with client_session.request(method, url, **kwargs) as response:
|
async with client_session.request(method, url, **kwargs) as response:
|
||||||
request_end = time.time()
|
request_end = time.time()
|
||||||
@@ -361,6 +366,14 @@ def send_prompt(sid: str, inputs: StreamingPrompt):
|
|||||||
|
|
||||||
@server.PromptServer.instance.routes.post("/comfyui-deploy/run")
|
@server.PromptServer.instance.routes.post("/comfyui-deploy/run")
|
||||||
async def comfy_deploy_run(request):
|
async def comfy_deploy_run(request):
|
||||||
|
# Extract the bearer token from the Authorization header
|
||||||
|
auth_header = request.headers.get('Authorization')
|
||||||
|
token = None
|
||||||
|
if auth_header:
|
||||||
|
parts = auth_header.split()
|
||||||
|
if len(parts) == 2 and parts[0].lower() == 'bearer':
|
||||||
|
token = parts[1]
|
||||||
|
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
|
|
||||||
# In older version, we use workflow_api, but this has inputs already swapped in nextjs frontend, which is tricky
|
# In older version, we use workflow_api, but this has inputs already swapped in nextjs frontend, which is tricky
|
||||||
@@ -376,13 +389,14 @@ async def comfy_deploy_run(request):
|
|||||||
prompt = {
|
prompt = {
|
||||||
"prompt": workflow_api,
|
"prompt": workflow_api,
|
||||||
"client_id": "comfy_deploy_instance", #api.client_id
|
"client_id": "comfy_deploy_instance", #api.client_id
|
||||||
"prompt_id": prompt_id
|
"prompt_id": prompt_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt_metadata[prompt_id] = SimplePrompt(
|
prompt_metadata[prompt_id] = SimplePrompt(
|
||||||
status_endpoint=data.get('status_endpoint'),
|
status_endpoint=data.get('status_endpoint'),
|
||||||
file_upload_endpoint=data.get('file_upload_endpoint'),
|
file_upload_endpoint=data.get('file_upload_endpoint'),
|
||||||
workflow_api=workflow_api
|
workflow_api=workflow_api,
|
||||||
|
token=token
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -420,7 +434,7 @@ async def comfy_deploy_run(request):
|
|||||||
|
|
||||||
return web.json_response(res, status=status)
|
return web.json_response(res, status=status)
|
||||||
|
|
||||||
async def stream_prompt(data):
|
async def stream_prompt(data, token):
|
||||||
# In older version, we use workflow_api, but this has inputs already swapped in nextjs frontend, which is tricky
|
# In older version, we use workflow_api, but this has inputs already swapped in nextjs frontend, which is tricky
|
||||||
workflow_api = data.get("workflow_api_raw")
|
workflow_api = data.get("workflow_api_raw")
|
||||||
# The prompt id generated from comfy deploy, can be None
|
# The prompt id generated from comfy deploy, can be None
|
||||||
@@ -440,7 +454,8 @@ async def stream_prompt(data):
|
|||||||
prompt_metadata[prompt_id] = SimplePrompt(
|
prompt_metadata[prompt_id] = SimplePrompt(
|
||||||
status_endpoint=data.get('status_endpoint'),
|
status_endpoint=data.get('status_endpoint'),
|
||||||
file_upload_endpoint=data.get('file_upload_endpoint'),
|
file_upload_endpoint=data.get('file_upload_endpoint'),
|
||||||
workflow_api=workflow_api
|
workflow_api=workflow_api,
|
||||||
|
token=token
|
||||||
)
|
)
|
||||||
|
|
||||||
# log('info', "Begin prompt", prompt=prompt)
|
# log('info', "Begin prompt", prompt=prompt)
|
||||||
@@ -489,6 +504,14 @@ comfy_message_queues: Dict[str, asyncio.Queue] = {}
|
|||||||
async def stream_response(request):
|
async def stream_response(request):
|
||||||
response = web.StreamResponse(status=200, reason='OK', headers={'Content-Type': 'text/event-stream'})
|
response = web.StreamResponse(status=200, reason='OK', headers={'Content-Type': 'text/event-stream'})
|
||||||
await response.prepare(request)
|
await response.prepare(request)
|
||||||
|
|
||||||
|
# Extract the bearer token from the Authorization header
|
||||||
|
auth_header = request.headers.get('Authorization')
|
||||||
|
token = None
|
||||||
|
if auth_header:
|
||||||
|
parts = auth_header.split()
|
||||||
|
if len(parts) == 2 and parts[0].lower() == 'bearer':
|
||||||
|
token = parts[1]
|
||||||
|
|
||||||
pending = True
|
pending = True
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
@@ -500,7 +523,7 @@ async def stream_response(request):
|
|||||||
log('info', 'Streaming prompt')
|
log('info', 'Streaming prompt')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = await stream_prompt(data=data)
|
result = await stream_prompt(data=data, token=token)
|
||||||
await response.write(f"event: event_update\ndata: {json.dumps(result)}\n\n".encode('utf-8'))
|
await response.write(f"event: event_update\ndata: {json.dumps(result)}\n\n".encode('utf-8'))
|
||||||
# await response.write(.encode('utf-8'))
|
# await response.write(.encode('utf-8'))
|
||||||
await response.drain() # Ensure the buffer is flushed
|
await response.drain() # Ensure the buffer is flushed
|
||||||
@@ -1045,6 +1068,7 @@ async def update_run_live_status(prompt_id, live_status, calculated_progress: fl
|
|||||||
return
|
return
|
||||||
|
|
||||||
status_endpoint = prompt_metadata[prompt_id].status_endpoint
|
status_endpoint = prompt_metadata[prompt_id].status_endpoint
|
||||||
|
token = prompt_metadata[prompt_id].token
|
||||||
|
|
||||||
if (status_endpoint is None):
|
if (status_endpoint is None):
|
||||||
return
|
return
|
||||||
@@ -1068,7 +1092,7 @@ async def update_run_live_status(prompt_id, live_status, calculated_progress: fl
|
|||||||
})
|
})
|
||||||
|
|
||||||
# requests.post(status_endpoint, json=body)
|
# requests.post(status_endpoint, json=body)
|
||||||
await async_request_with_retry('POST', status_endpoint, json=body)
|
await async_request_with_retry('POST', status_endpoint, token=token, json=body)
|
||||||
|
|
||||||
|
|
||||||
async def update_run(prompt_id: str, status: Status):
|
async def update_run(prompt_id: str, status: Status):
|
||||||
@@ -1099,7 +1123,8 @@ async def update_run(prompt_id: str, status: Status):
|
|||||||
try:
|
try:
|
||||||
# requests.post(status_endpoint, json=body)
|
# requests.post(status_endpoint, json=body)
|
||||||
if (status_endpoint is not None):
|
if (status_endpoint is not None):
|
||||||
await async_request_with_retry('POST', status_endpoint, json=body)
|
token = prompt_metadata[prompt_id].token
|
||||||
|
await async_request_with_retry('POST', status_endpoint, token=token, json=body)
|
||||||
|
|
||||||
if (status_endpoint is not None) and cd_enable_run_log and (status == Status.SUCCESS or status == Status.FAILED):
|
if (status_endpoint is not None) and cd_enable_run_log and (status == Status.SUCCESS or status == Status.FAILED):
|
||||||
try:
|
try:
|
||||||
@@ -1129,7 +1154,7 @@ async def update_run(prompt_id: str, status: Status):
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
await async_request_with_retry('POST', status_endpoint, json=body)
|
await async_request_with_retry('POST', status_endpoint, token=token, json=body)
|
||||||
# requests.post(status_endpoint, json=body)
|
# requests.post(status_endpoint, json=body)
|
||||||
except Exception as log_error:
|
except Exception as log_error:
|
||||||
logger.info(f"Error reading log file: {log_error}")
|
logger.info(f"Error reading log file: {log_error}")
|
||||||
@@ -1180,7 +1205,7 @@ async def upload_file(prompt_id, filename, subfolder=None, content_type="image/p
|
|||||||
logger.info(f"Uploading file {file}")
|
logger.info(f"Uploading file {file}")
|
||||||
|
|
||||||
file_upload_endpoint = prompt_metadata[prompt_id].file_upload_endpoint
|
file_upload_endpoint = prompt_metadata[prompt_id].file_upload_endpoint
|
||||||
|
token = prompt_metadata[prompt_id].token
|
||||||
filename = quote(filename)
|
filename = quote(filename)
|
||||||
prompt_id = quote(prompt_id)
|
prompt_id = quote(prompt_id)
|
||||||
content_type = quote(content_type)
|
content_type = quote(content_type)
|
||||||
@@ -1192,7 +1217,7 @@ async def upload_file(prompt_id, filename, subfolder=None, content_type="image/p
|
|||||||
|
|
||||||
start_time = time.time() # Start timing here
|
start_time = time.time() # Start timing here
|
||||||
logger.info(f"Target URL: {target_url}")
|
logger.info(f"Target URL: {target_url}")
|
||||||
result = await async_request_with_retry("GET", target_url, disable_timeout=True)
|
result = await async_request_with_retry("GET", target_url, disable_timeout=True, token=token)
|
||||||
end_time = time.time() # End timing after the request is complete
|
end_time = time.time() # End timing after the request is complete
|
||||||
logger.info("Time taken for getting file upload endpoint: {:.2f} seconds".format(end_time - start_time))
|
logger.info("Time taken for getting file upload endpoint: {:.2f} seconds".format(end_time - start_time))
|
||||||
ok = await result.json()
|
ok = await result.json()
|
||||||
@@ -1219,6 +1244,8 @@ async def upload_file(prompt_id, filename, subfolder=None, content_type="image/p
|
|||||||
if file_download_url is not None:
|
if file_download_url is not None:
|
||||||
item["url"] = file_download_url
|
item["url"] = file_download_url
|
||||||
item["upload_duration"] = end_time - start_time
|
item["upload_duration"] = end_time - start_time
|
||||||
|
if ok.get("is_public") is not None:
|
||||||
|
item["is_public"] = ok.get("is_public")
|
||||||
|
|
||||||
def have_pending_upload(prompt_id):
|
def have_pending_upload(prompt_id):
|
||||||
if prompt_id in prompt_metadata and len(prompt_metadata[prompt_id].uploading_nodes) > 0:
|
if prompt_id in prompt_metadata and len(prompt_metadata[prompt_id].uploading_nodes) > 0:
|
||||||
@@ -1352,6 +1379,7 @@ async def upload_in_background(prompt_id: str, data, node_id=None, have_upload=T
|
|||||||
await asyncio.gather(*upload_tasks)
|
await asyncio.gather(*upload_tasks)
|
||||||
|
|
||||||
status_endpoint = prompt_metadata[prompt_id].status_endpoint
|
status_endpoint = prompt_metadata[prompt_id].status_endpoint
|
||||||
|
token = prompt_metadata[prompt_id].token
|
||||||
if have_upload:
|
if have_upload:
|
||||||
if status_endpoint is not None:
|
if status_endpoint is not None:
|
||||||
body = {
|
body = {
|
||||||
@@ -1360,7 +1388,7 @@ async def upload_in_background(prompt_id: str, data, node_id=None, have_upload=T
|
|||||||
"node_meta": node_meta,
|
"node_meta": node_meta,
|
||||||
}
|
}
|
||||||
# pprint(body)
|
# pprint(body)
|
||||||
await async_request_with_retry('POST', status_endpoint, json=body)
|
await async_request_with_retry('POST', status_endpoint, token=token, json=body)
|
||||||
await update_file_status(prompt_id, data, False, node_id=node_id)
|
await update_file_status(prompt_id, data, False, node_id=node_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
await handle_error(prompt_id, data, e)
|
await handle_error(prompt_id, data, e)
|
||||||
@@ -1398,7 +1426,8 @@ async def update_run_with_output(prompt_id, data, node_id=None, node_meta=None):
|
|||||||
await handle_error(prompt_id, data, e)
|
await handle_error(prompt_id, data, e)
|
||||||
# requests.post(status_endpoint, json=body)
|
# requests.post(status_endpoint, json=body)
|
||||||
elif status_endpoint is not None:
|
elif status_endpoint is not None:
|
||||||
await async_request_with_retry('POST', status_endpoint, json=body)
|
token = prompt_metadata[prompt_id].token
|
||||||
|
await async_request_with_retry('POST', status_endpoint, token=token, json=body)
|
||||||
|
|
||||||
await send('outputs_uploaded', {
|
await send('outputs_uploaded', {
|
||||||
"prompt_id": prompt_id
|
"prompt_id": prompt_id
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ class SimplePrompt(BaseModel):
|
|||||||
status_endpoint: Optional[str]
|
status_endpoint: Optional[str]
|
||||||
file_upload_endpoint: Optional[str]
|
file_upload_endpoint: Optional[str]
|
||||||
|
|
||||||
|
token: Optional[str]
|
||||||
|
|
||||||
workflow_api: dict
|
workflow_api: dict
|
||||||
status: Status = Status.NOT_STARTED
|
status: Status = Status.NOT_STARTED
|
||||||
progress: set = set()
|
progress: set = set()
|
||||||
|
|||||||
+88
-89
@@ -192,13 +192,11 @@ const ext = {
|
|||||||
|
|
||||||
registerCustomNodes() {
|
registerCustomNodes() {
|
||||||
/** @type {LGraphNode}*/
|
/** @type {LGraphNode}*/
|
||||||
class ComfyDeploy extends LGraphNode {
|
class ComfyDeploy {
|
||||||
|
color = LGraphCanvas.node_colors.yellow.color;
|
||||||
|
bgcolor = LGraphCanvas.node_colors.yellow.bgcolor;
|
||||||
|
groupcolor = LGraphCanvas.node_colors.yellow.groupcolor;
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
|
||||||
this.color = LGraphCanvas.node_colors.yellow.color;
|
|
||||||
this.bgcolor = LGraphCanvas.node_colors.yellow.bgcolor;
|
|
||||||
this.groupcolor = LGraphCanvas.node_colors.yellow.groupcolor;
|
|
||||||
|
|
||||||
if (!this.properties) {
|
if (!this.properties) {
|
||||||
this.properties = {};
|
this.properties = {};
|
||||||
this.properties.workflow_name = "";
|
this.properties.workflow_name = "";
|
||||||
@@ -206,75 +204,65 @@ const ext = {
|
|||||||
this.properties.version = "";
|
this.properties.version = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addWidget(
|
ComfyWidgets.STRING(
|
||||||
"text",
|
this,
|
||||||
"workflow_name",
|
"workflow_name",
|
||||||
this.properties.workflow_name,
|
[
|
||||||
(v) => {
|
"",
|
||||||
this.properties.workflow_name = v;
|
{
|
||||||
},
|
default: this.properties.workflow_name,
|
||||||
{ multiline: false }
|
multiline: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
app,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.addWidget(
|
ComfyWidgets.STRING(
|
||||||
"text",
|
this,
|
||||||
"workflow_id",
|
"workflow_id",
|
||||||
this.properties.workflow_id,
|
[
|
||||||
(v) => {
|
"",
|
||||||
this.properties.workflow_id = v;
|
{
|
||||||
},
|
default: this.properties.workflow_id,
|
||||||
{ multiline: false }
|
multiline: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
app,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.addWidget(
|
ComfyWidgets.STRING(
|
||||||
"text",
|
this,
|
||||||
"version",
|
"version",
|
||||||
this.properties.version,
|
["", { default: this.properties.version, multiline: false }],
|
||||||
(v) => {
|
app,
|
||||||
this.properties.version = v;
|
|
||||||
},
|
|
||||||
{ multiline: false }
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// this.widgets.forEach((w) => {
|
||||||
|
// // w.computeSize = () => [200,10]
|
||||||
|
// w.computedHeight = 2;
|
||||||
|
// })
|
||||||
|
|
||||||
this.widgets_start_y = 10;
|
this.widgets_start_y = 10;
|
||||||
|
this.setSize(this.computeSize());
|
||||||
|
|
||||||
|
// const config = { };
|
||||||
|
|
||||||
|
// console.log(this);
|
||||||
this.serialize_widgets = true;
|
this.serialize_widgets = true;
|
||||||
this.isVirtualNode = true;
|
this.isVirtualNode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
onExecute() {
|
|
||||||
// This method is called when the node is executed
|
|
||||||
// You can add any necessary logic here
|
|
||||||
}
|
|
||||||
|
|
||||||
onSerialize(o) {
|
|
||||||
// This method is called when the node is being serialized
|
|
||||||
// Ensure all necessary data is saved
|
|
||||||
if (!o.properties) {
|
|
||||||
o.properties = {};
|
|
||||||
}
|
|
||||||
o.properties.workflow_name = this.properties.workflow_name;
|
|
||||||
o.properties.workflow_id = this.properties.workflow_id;
|
|
||||||
o.properties.version = this.properties.version;
|
|
||||||
}
|
|
||||||
|
|
||||||
onConfigure(o) {
|
|
||||||
// This method is called when the node is being configured (e.g., when loading a saved graph)
|
|
||||||
// Ensure all necessary data is restored
|
|
||||||
if (o.properties) {
|
|
||||||
this.properties = { ...this.properties, ...o.properties };
|
|
||||||
this.widgets[0].value = this.properties.workflow_name || "";
|
|
||||||
this.widgets[1].value = this.properties.workflow_id || "";
|
|
||||||
this.widgets[2].value = this.properties.version || "1";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register the node type
|
// Load default visibility
|
||||||
LiteGraph.registerNodeType("ComfyDeploy", Object.assign(ComfyDeploy, {
|
|
||||||
title: "Comfy Deploy",
|
LiteGraph.registerNodeType(
|
||||||
title_mode: LiteGraph.NORMAL_TITLE,
|
"ComfyDeploy",
|
||||||
collapsable: true,
|
Object.assign(ComfyDeploy, {
|
||||||
}));
|
title_mode: LiteGraph.NORMAL_TITLE,
|
||||||
|
title: "Comfy Deploy",
|
||||||
|
collapsable: true,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
ComfyDeploy.category = "deploy";
|
ComfyDeploy.category = "deploy";
|
||||||
},
|
},
|
||||||
@@ -443,10 +431,10 @@ function createDynamicUIHtml(data) {
|
|||||||
<h3 style="font-size: 14px; font-weight: semibold; margin-bottom: 8px;">Missing Nodes</h3>
|
<h3 style="font-size: 14px; font-weight: semibold; margin-bottom: 8px;">Missing Nodes</h3>
|
||||||
<p style="font-size: 12px;">These nodes are not found with any matching custom_nodes in the ComfyUI Manager Database</p>
|
<p style="font-size: 12px;">These nodes are not found with any matching custom_nodes in the ComfyUI Manager Database</p>
|
||||||
${data.missing_nodes
|
${data.missing_nodes
|
||||||
.map((node) => {
|
.map((node) => {
|
||||||
return `<p style="font-size: 14px; color: #d69e2e;">${node}</p>`;
|
return `<p style="font-size: 14px; color: #d69e2e;">${node}</p>`;
|
||||||
})
|
})
|
||||||
.join("")}
|
.join("")}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -454,14 +442,17 @@ function createDynamicUIHtml(data) {
|
|||||||
Object.values(data.custom_nodes).forEach((node) => {
|
Object.values(data.custom_nodes).forEach((node) => {
|
||||||
html += `
|
html += `
|
||||||
<div style="border-bottom: 1px solid #e2e8f0; padding-top: 16px;">
|
<div style="border-bottom: 1px solid #e2e8f0; padding-top: 16px;">
|
||||||
<a href="${node.url
|
<a href="${
|
||||||
}" target="_blank" style="font-size: 18px; font-weight: semibold; color: white; text-decoration: none;">${node.name
|
node.url
|
||||||
}</a>
|
}" target="_blank" style="font-size: 18px; font-weight: semibold; color: white; text-decoration: none;">${
|
||||||
|
node.name
|
||||||
|
}</a>
|
||||||
<p style="font-size: 14px; color: #4b5563;">${node.hash}</p>
|
<p style="font-size: 14px; color: #4b5563;">${node.hash}</p>
|
||||||
${node.warning
|
${
|
||||||
? `<p style="font-size: 14px; color: #d69e2e;">${node.warning}</p>`
|
node.warning
|
||||||
: ""
|
? `<p style="font-size: 14px; color: #d69e2e;">${node.warning}</p>`
|
||||||
}
|
: ""
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
@@ -475,8 +466,9 @@ function createDynamicUIHtml(data) {
|
|||||||
Object.entries(data.models).forEach(([section, items]) => {
|
Object.entries(data.models).forEach(([section, items]) => {
|
||||||
html += `
|
html += `
|
||||||
<div style="border-bottom: 1px solid #e2e8f0; padding-top: 8px; padding-bottom: 8px;">
|
<div style="border-bottom: 1px solid #e2e8f0; padding-top: 8px; padding-bottom: 8px;">
|
||||||
<h3 style="font-size: 18px; font-weight: semibold; margin-bottom: 8px;">${section.charAt(0).toUpperCase() + section.slice(1)
|
<h3 style="font-size: 18px; font-weight: semibold; margin-bottom: 8px;">${
|
||||||
}</h3>`;
|
section.charAt(0).toUpperCase() + section.slice(1)
|
||||||
|
}</h3>`;
|
||||||
items.forEach((item) => {
|
items.forEach((item) => {
|
||||||
html += `<p style="font-size: 14px; color: ${textColor};">${item.name}</p>`;
|
html += `<p style="font-size: 14px; color: ${textColor};">${item.name}</p>`;
|
||||||
});
|
});
|
||||||
@@ -492,8 +484,9 @@ function createDynamicUIHtml(data) {
|
|||||||
Object.entries(data.files).forEach(([section, items]) => {
|
Object.entries(data.files).forEach(([section, items]) => {
|
||||||
html += `
|
html += `
|
||||||
<div style="border-bottom: 1px solid #e2e8f0; padding-top: 8px; padding-bottom: 8px;">
|
<div style="border-bottom: 1px solid #e2e8f0; padding-top: 8px; padding-bottom: 8px;">
|
||||||
<h3 style="font-size: 18px; font-weight: semibold; margin-bottom: 8px;">${section.charAt(0).toUpperCase() + section.slice(1)
|
<h3 style="font-size: 18px; font-weight: semibold; margin-bottom: 8px;">${
|
||||||
}</h3>`;
|
section.charAt(0).toUpperCase() + section.slice(1)
|
||||||
|
}</h3>`;
|
||||||
items.forEach((item) => {
|
items.forEach((item) => {
|
||||||
html += `<p style="font-size: 14px; color: ${textColor};">${item.name}</p>`;
|
html += `<p style="font-size: 14px; color: ${textColor};">${item.name}</p>`;
|
||||||
});
|
});
|
||||||
@@ -1013,12 +1006,14 @@ export class LoadingDialog extends ComfyDialog {
|
|||||||
showLoading(title, message) {
|
showLoading(title, message) {
|
||||||
this.show(`
|
this.show(`
|
||||||
<div style="width: 400px; display: flex; gap: 18px; flex-direction: column; overflow: unset">
|
<div style="width: 400px; display: flex; gap: 18px; flex-direction: column; overflow: unset">
|
||||||
<h3 style="margin: 0px; display: flex; align-items: center; justify-content: center; gap: 12px;">${title} ${this.loadingIcon
|
<h3 style="margin: 0px; display: flex; align-items: center; justify-content: center; gap: 12px;">${title} ${
|
||||||
}</h3>
|
this.loadingIcon
|
||||||
${message
|
}</h3>
|
||||||
? `<label style="max-width: 100%; white-space: pre-wrap; word-wrap: break-word;">${message}</label>`
|
${
|
||||||
: ""
|
message
|
||||||
}
|
? `<label style="max-width: 100%; white-space: pre-wrap; word-wrap: break-word;">${message}</label>`
|
||||||
|
: ""
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
@@ -1284,17 +1279,21 @@ export class ConfigDialog extends ComfyDialog {
|
|||||||
</label>
|
</label>
|
||||||
<label style="color: white; width: 100%;">
|
<label style="color: white; width: 100%;">
|
||||||
Endpoint:
|
Endpoint:
|
||||||
<input id="endpoint" style="margin-top: 8px; width: 100%; height:40px; box-sizing: border-box; padding: 0px 6px;" type="text" value="${data.endpoint
|
<input id="endpoint" style="margin-top: 8px; width: 100%; height:40px; box-sizing: border-box; padding: 0px 6px;" type="text" value="${
|
||||||
}">
|
data.endpoint
|
||||||
|
}">
|
||||||
</label>
|
</label>
|
||||||
<div style="color: white;">
|
<div style="color: white;">
|
||||||
API Key: User / Org <button style="font-size: 18px;">${data.displayName ?? ""
|
API Key: User / Org <button style="font-size: 18px;">${
|
||||||
}</button>
|
data.displayName ?? ""
|
||||||
<input id="apiKey" style="margin-top: 8px; width: 100%; height:40px; box-sizing: border-box; padding: 0px 6px;" type="password" value="${data.apiKey
|
}</button>
|
||||||
}">
|
<input id="apiKey" style="margin-top: 8px; width: 100%; height:40px; box-sizing: border-box; padding: 0px 6px;" type="password" value="${
|
||||||
|
data.apiKey
|
||||||
|
}">
|
||||||
<button id="loginButton" style="margin-top: 8px; width: 100%; height:40px; box-sizing: border-box; padding: 0px 6px;">
|
<button id="loginButton" style="margin-top: 8px; width: 100%; height:40px; box-sizing: border-box; padding: 0px 6px;">
|
||||||
${data.apiKey ? "Re-login with ComfyDeploy" : "Login with ComfyDeploy"
|
${
|
||||||
}
|
data.apiKey ? "Re-login with ComfyDeploy" : "Login with ComfyDeploy"
|
||||||
|
}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user