Skip to content

Commit 6867616

Browse files
committed
Merge branch 'main' into draft-v4
2 parents cf8029e + c9271b1 commit 6867616

File tree

12 files changed

+4350
-3955
lines changed

12 files changed

+4350
-3955
lines changed

comfyui_manager/legacy/share_3rdparty.py

Lines changed: 66 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,7 @@ async def share_art(request):
337337
content_type = assetFileType
338338

339339
try:
340-
from matrix_client.api import MatrixHttpApi
341-
from matrix_client.client import MatrixClient
340+
from nio import AsyncClient, LoginResponse, UploadResponse
342341

343342
homeserver = 'matrix.org'
344343
if matrix_auth:
@@ -347,31 +346,81 @@ async def share_art(request):
347346
if not homeserver.startswith("https://"):
348347
homeserver = "https://" + homeserver
349348

350-
client = MatrixClient(homeserver)
351-
try:
352-
token = client.login(username=matrix_auth['username'], password=matrix_auth['password'])
353-
if not token:
354-
return web.json_response({"error": "Invalid Matrix credentials."}, content_type='application/json', status=400)
355-
except Exception:
349+
client = AsyncClient(homeserver, matrix_auth['username'])
350+
351+
# Login
352+
login_resp = await client.login(matrix_auth['password'])
353+
if not isinstance(login_resp, LoginResponse) or not login_resp.access_token:
354+
await client.close()
356355
return web.json_response({"error": "Invalid Matrix credentials."}, content_type='application/json', status=400)
357356

358-
matrix = MatrixHttpApi(homeserver, token=token)
357+
# Upload asset
359358
with open(asset_filepath, 'rb') as f:
360-
mxc_url = matrix.media_upload(f.read(), content_type, filename=filename)['content_uri']
361-
362-
workflow_json_mxc_url = matrix.media_upload(prompt['workflow'], 'application/json', filename='workflow.json')['content_uri']
363-
359+
upload_resp, _maybe_keys = await client.upload(f, content_type=content_type, filename=filename)
360+
asset_data = f.seek(0) or f.read() # get size for info below
361+
if not isinstance(upload_resp, UploadResponse) or not upload_resp.content_uri:
362+
await client.close()
363+
return web.json_response({"error": "Failed to upload asset to Matrix."}, content_type='application/json', status=500)
364+
mxc_url = upload_resp.content_uri
365+
366+
# Upload workflow JSON
367+
import io
368+
workflow_json_bytes = json.dumps(prompt['workflow']).encode('utf-8')
369+
workflow_io = io.BytesIO(workflow_json_bytes)
370+
upload_workflow_resp, _maybe_keys = await client.upload(workflow_io, content_type='application/json', filename='workflow.json')
371+
workflow_io.seek(0)
372+
if not isinstance(upload_workflow_resp, UploadResponse) or not upload_workflow_resp.content_uri:
373+
await client.close()
374+
return web.json_response({"error": "Failed to upload workflow to Matrix."}, content_type='application/json', status=500)
375+
workflow_json_mxc_url = upload_workflow_resp.content_uri
376+
377+
# Send text message
364378
text_content = ""
365379
if title:
366380
text_content += f"{title}\n"
367381
if description:
368382
text_content += f"{description}\n"
369383
if credits:
370384
text_content += f"\ncredits: {credits}\n"
371-
matrix.send_message(comfyui_share_room_id, text_content)
372-
matrix.send_content(comfyui_share_room_id, mxc_url, filename, 'm.image')
373-
matrix.send_content(comfyui_share_room_id, workflow_json_mxc_url, 'workflow.json', 'm.file')
374-
except Exception:
385+
await client.room_send(
386+
room_id=comfyui_share_room_id,
387+
message_type="m.room.message",
388+
content={"msgtype": "m.text", "body": text_content}
389+
)
390+
391+
# Send image
392+
await client.room_send(
393+
room_id=comfyui_share_room_id,
394+
message_type="m.room.message",
395+
content={
396+
"msgtype": "m.image",
397+
"body": filename,
398+
"url": mxc_url,
399+
"info": {
400+
"mimetype": content_type,
401+
"size": len(asset_data)
402+
}
403+
}
404+
)
405+
406+
# Send workflow JSON file
407+
await client.room_send(
408+
room_id=comfyui_share_room_id,
409+
message_type="m.room.message",
410+
content={
411+
"msgtype": "m.file",
412+
"body": "workflow.json",
413+
"url": workflow_json_mxc_url,
414+
"info": {
415+
"mimetype": "application/json",
416+
"size": len(workflow_json_bytes)
417+
}
418+
}
419+
)
420+
421+
await client.close()
422+
423+
except:
375424
import traceback
376425
traceback.print_exc()
377426
return web.json_response({"error": "An error occurred when sharing your art to Matrix."}, content_type='application/json', status=500)

custom-node-list.json

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5182,6 +5182,16 @@
51825182
"install_type": "git-clone",
51835183
"description": "Nodes:Bing Image Grabber, Zephyr chat, Hermes Chat"
51845184
},
5185+
{
5186+
"author": "concarne000",
5187+
"title": "ComfyUI-Stacker",
5188+
"reference": "https://github.com/concarne000/ComfyUI-Stacker",
5189+
"files": [
5190+
"https://github.com/concarne000/ComfyUI-Stacker"
5191+
],
5192+
"install_type": "git-clone",
5193+
"description": "Simple stack push/pop style nodes for images, strings, integers and generic objects (image batches, latents, face models etc)"
5194+
},
51855195
{
51865196
"author": "Aegis72",
51875197
"title": "AegisFlow Utility Nodes",
@@ -27158,6 +27168,16 @@
2715827168
"install_type": "git-clone",
2715927169
"description": "ComfyUI-Lightx2vWrapper is an inference wrapper for Lightx2v designed for use with ComfyUI."
2716027170
},
27171+
{
27172+
"author": "GACLove",
27173+
"title": "ComfyUI-VFI",
27174+
"reference": "https://github.com/GACLove/ComfyUI-VFI",
27175+
"files": [
27176+
"https://github.com/GACLove/ComfyUI-VFI"
27177+
],
27178+
"install_type": "git-clone",
27179+
"description": "ComfyUI-RIFE is an inference wrapper for RIFE designed for use with ComfyUI."
27180+
},
2716127181
{
2716227182
"author": "Yahweasel",
2716327183
"title": "ComfyUI-MinDalle",
@@ -29798,16 +29818,16 @@
2979829818
"description": "A custom node extension for ComfyUI that integrates Google's Veo 3 text-to-video generation capabilities."
2979929819
},
2980029820
{
29801-
"author": "BuimenLabo",
29802-
"title": "ComfyUI BuimenLabo - Unified Package",
29821+
"author": "builmenlabo",
29822+
"title": "ComfyUI builmenlabo - Unified Package",
2980329823
"id": "builmenlabo",
2980429824
"reference": "https://github.com/comnote-max/builmenlabo",
2980529825
"files": [
2980629826
"https://github.com/comnote-max/builmenlabo"
2980729827
],
2980829828
"install_type": "git-clone",
2980929829
"description": "Comprehensive collection of ComfyUI custom nodes: 🦙 Advanced LLM text generation with Llama-CPP (CPU/GPU acceleration), 🌐 Smart multi-language prompt translation (Google/DeepL/Yandex/Baidu), 🌍 20-language interface toggle, 📸 AI-powered Gemini pose analysis, 🎛️ Smart ControlNet management. Perfect unified package for AI artists and creators. Blog: https://note.com/hirodream44",
29810-
"nodename_pattern": "BuimenLabo",
29830+
"nodename_pattern": "builmenlabo",
2981129831
"tags": [
2981229832
"LLM",
2981329833
"translation",
@@ -29831,6 +29851,47 @@
2983129851
"install_type": "git-clone",
2983229852
"description": "ComfyUI custom nodes for interacting with the Gemini api for image and video generation prompting."
2983329853
},
29854+
{
29855+
"author": "GeraldWie",
29856+
"title": "ComfyUI-I2I-slim",
29857+
"reference": "https://github.com/GeraldWie/ComfyUI-I2I-slim",
29858+
"files": [
29859+
"https://github.com/GeraldWie/ComfyUI-I2I-slim"
29860+
],
29861+
"install_type": "git-clone",
29862+
"description": "A lightweight version of the custom nodes originally developed by [a/ManglerFTW](https://github.com/ManglerFTW/ComfyI2I) for performing image-to-image tasks in ComfyUI."
29863+
},
29864+
{
29865+
"author": "tauraloke",
29866+
"title": "ComfyUI-Unfake-Pixels",
29867+
"reference": "https://github.com/tauraloke/ComfyUI-Unfake-Pixels",
29868+
"files": [
29869+
"https://github.com/tauraloke/ComfyUI-Unfake-Pixels"
29870+
],
29871+
"install_type": "git-clone",
29872+
"description": "A ComfyUI node for pixel art scaling. Automatically detects the pixel scale using an edge-aware method (Sobel filter + voting on tiles) and downscales the image to that pixel size, reducing color palette."
29873+
},
29874+
{
29875+
"author": "adrianschubek",
29876+
"title": "comfyui-zeug",
29877+
"reference": "https://github.com/adrianschubek/comfyui-zeug",
29878+
"files": [
29879+
"https://github.com/adrianschubek/comfyui-zeug"
29880+
],
29881+
"install_type": "git-clone",
29882+
"description": "comfyui-zeug (German for 'gear' or 'stuff') is a collection of custom nodes for ComfyUI, designed to enhance functionality and provide additional features."
29883+
},
29884+
{
29885+
"author": "g0kuvonlange",
29886+
"title": "ComfyUI Load From URL",
29887+
"reference": "https://github.com/g0kuvonlange/ComfyUI-Load-From-URL",
29888+
"files": [
29889+
"https://github.com/g0kuvonlange/ComfyUI-Load-From-URL"
29890+
],
29891+
"install_type": "git-clone",
29892+
"description": "A simple custom node for ComfyUI to load LoRAs and videos directly from a URL. Ideal for users hosting files on a server with publicly accessible URLs."
29893+
},
29894+
2983429895

2983529896

2983629897

0 commit comments

Comments
 (0)