Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b139f05110 | ||
|
|
6bfc8f1fe2 | ||
|
|
4b44de4815 | ||
|
|
7e4d023983 | ||
|
|
25b6a30685 | ||
|
|
f7a9d0e2b0 | ||
|
|
3e7225e5da | ||
|
|
2e5cc1e4a9 | ||
|
|
799d08ee36 | ||
|
|
596ae76917 | ||
|
|
7a2c1f2d09 | ||
|
|
8862e38cee | ||
|
|
e9e339f43e | ||
|
|
a7e7dfe0d2 | ||
|
|
c6e96f8b60 | ||
|
|
4021002596 | ||
|
|
4bbf341bea |
@@ -0,0 +1,26 @@
|
||||
name: Publish to Comfy registry
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths:
|
||||
- "pyproject.toml"
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
publish-node:
|
||||
name: Publish Custom Node to registry
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.repository_owner == 'MijnSpam' }}
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Publish Custom Node
|
||||
uses: Comfy-Org/publish-node-action@main
|
||||
with:
|
||||
## Add your own personal access token to your Github Repository secrets and reference it here.
|
||||
personal_access_token: ${{ secrets.COMFY }}
|
||||
@@ -1 +1,2 @@
|
||||
.env
|
||||
.github/
|
||||
@@ -4,7 +4,7 @@ Thanks to Jerryswap UploadToWebhook customnode which I could use as base code fo
|
||||
|
||||
|
||||
|
||||

|
||||

|
||||
|
||||
A custom node for [ComfyUI](https://github.com/comfyanonymous/ComfyUI) that allows you to _send generated image(s)_ directly to Pushover, you can also choose only to get a notifycation. Videos aren't supported.
|
||||
|
||||
@@ -17,7 +17,7 @@ A custom node for [ComfyUI](https://github.com/comfyanonymous/ComfyUI) that allo
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Installation
|
||||
## 🔧 Installation (for updating from v1.0.x to v1.2.x read the update.md file.)
|
||||
|
||||
1. Clone or download this repo into your `ComfyUI/custom_nodes` directory:
|
||||
|
||||
@@ -48,17 +48,23 @@ In User field, enter specific device key **or** add group key.
|
||||
|
||||
In ComfyUI:
|
||||
|
||||
1. Drag your image output (e.g., from `VAE Decode`) to the **Send To Http Webhook** node.
|
||||

|
||||
1. Drag any output (e.g., from `VAE Decode`) to the **Send To Pushover** node >> connect_anything
|
||||

|
||||
2. Configure:
|
||||
- `connect_anything` : connect any output (mandatory to work)
|
||||
- `webhook_url`: default is correct.
|
||||
- `token`: the pushover app token
|
||||
- `token`: the pushover app token (or use stored credentials option, see step 3)
|
||||
- `user`: Your user OR group key.
|
||||
- `image`: if you want an image in your pushover, connect this node and switch on attach_image
|
||||
3. Optional (since version 1.2)
|
||||
create an .env in the same folder as this custom-node, see example folder but rename to '.env'
|
||||
in the node select, 'use stored credentials', any credentials in the node fields will be ignored **even when you enter them!**
|
||||
---
|
||||
|
||||
## 🖼️ UI Example
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
@@ -69,6 +75,8 @@ ComfyUI_UploadToWebHookPushOver/
|
||||
├── __init__.py
|
||||
├── requirements.txt
|
||||
└── install.sh
|
||||
└── pyproject.toml
|
||||
└── .env (optional file see how to use step 3)
|
||||
```
|
||||
|
||||
---
|
||||
@@ -84,3 +92,10 @@ Feel free to fork and create a PR.
|
||||
|
||||
This project is licensed under the MIT License.
|
||||
See [LICENSE](./LICENSE) for details.
|
||||
|
||||
## Other custom nodes (search for "KB comfy" in manager)
|
||||
- Swap and Scale
|
||||
|
||||
## Changelog
|
||||
|
||||
1.2.2 Trying to fix custom-node update issue.
|
||||
@@ -6,45 +6,70 @@ import base64
|
||||
from PIL import Image
|
||||
import folder_paths
|
||||
|
||||
# wildcard trick is taken from pythongossss's
|
||||
class AnyType(str):
|
||||
def __ne__(self, __value: object) -> bool:
|
||||
return False
|
||||
|
||||
any_typ = AnyType("*")
|
||||
def load_env_variable(file_path, variable_name):
|
||||
# Read the .env file
|
||||
try:
|
||||
with open(file_path, 'r') as env_file:
|
||||
for line in env_file:
|
||||
key_value = line.strip().split('=')
|
||||
if len(key_value) == 2 and key_value[0] == variable_name:
|
||||
return key_value[1].strip()
|
||||
except FileNotFoundError:
|
||||
print(f"Error: The file {file_path} was not found.")
|
||||
except Exception as e:
|
||||
print(f"An error occurred while reading the .env file: {e}")
|
||||
# Return None if the variable is not found
|
||||
return None
|
||||
|
||||
class UploadToPushOver:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"images": ("IMAGE",),
|
||||
"connect_anything": (any_typ,),
|
||||
"webhook_url": ("STRING", {"default": "https://api.pushover.net/1/messages.json"}),
|
||||
"token": ("STRING", {"default": "enter your application key"}),
|
||||
"user": ("STRING", {"default": "enter user or group key"}),
|
||||
"title": ("STRING", {"default": ""}),
|
||||
"title": ("STRING", {"default": "Comfy push title"}),
|
||||
"priority": ("INT", {"default": 0, "lowest": -2, "max": 2}),
|
||||
"sound":(["pushover", "bike", "bugle", "cashregister", "classical", "cosmic", "falling", "gamelan", "incoming", "intermission", "magic", "mechanical", "pianobar", "siren", "spacealarm", "tugboat", "alien", "climb", "persistent", "echo", "updown", "vibrate", "none"],),
|
||||
"attachment_type":("STRING", {"default": "image/png"}),
|
||||
"attach_image": ("BOOLEAN", {"default": True}),
|
||||
"prompt_id": ("STRING", {"default": "Will be your pushover message, when empty: Workflow ready", "multiline": True})
|
||||
},
|
||||
"optional": {
|
||||
"images": ("IMAGE",),
|
||||
"token": ("STRING", {"default": "enter your application key"}),
|
||||
"user": ("STRING", {"default": "enter user or group key"}),
|
||||
"use_stored_credentials": ("BOOLEAN", {"default": False}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
RETURN_TYPES = (any_typ,)
|
||||
OUTPUT_NODE = True
|
||||
CATEGORY = "Notification"
|
||||
FUNCTION = "generate_and_upload_image"
|
||||
|
||||
|
||||
def generate_and_upload_image(
|
||||
self,
|
||||
images,
|
||||
connect_anything,
|
||||
webhook_url: str,
|
||||
use_stored_credentials:False,
|
||||
token: str,
|
||||
title: str,
|
||||
user: str,
|
||||
priority: int,
|
||||
sound: str,
|
||||
attachment_type: str,
|
||||
attach_image: True,
|
||||
save_image=True,
|
||||
attach_image:True,
|
||||
prompt_id: str = "",
|
||||
images: str = "",
|
||||
):
|
||||
output_dir = folder_paths.get_output_directory() if save_image else folder_paths.get_temp_directory()
|
||||
|
||||
output_dir = folder_paths.get_temp_directory()
|
||||
#output_dir = folder_paths.get_output_directory() if save_image else folder_paths.get_temp_directory()
|
||||
# above is old line from original webhook creator
|
||||
(
|
||||
full_output_folder,
|
||||
filename,
|
||||
@@ -59,8 +84,17 @@ class UploadToPushOver:
|
||||
parsed_data["message"] = prompt_id
|
||||
else:
|
||||
parsed_data["message"] = "Workflow ready" # message can't be empty, pushover wont accept it.
|
||||
parsed_data["token"] = token
|
||||
parsed_data["user"] = user
|
||||
## if stored credentials are used load from file else use input fields.
|
||||
if use_stored_credentials:
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
env_file_path = os.path.join(current_dir, '.env')
|
||||
apptoken = load_env_variable(env_file_path, 'apptoken')
|
||||
usertoken = load_env_variable(env_file_path, 'usertoken')
|
||||
parsed_data["token"] = apptoken
|
||||
parsed_data["user"] = usertoken
|
||||
else:
|
||||
parsed_data["token"] = token
|
||||
parsed_data["user"] = user
|
||||
parsed_data["title"] = title
|
||||
parsed_data["priority"] = priority
|
||||
parsed_data["sound"] = sound
|
||||
@@ -71,7 +105,6 @@ class UploadToPushOver:
|
||||
single_image = 255.0 * images[0].cpu().numpy()
|
||||
single_image_pil = Image.fromarray(single_image.astype(np.uint8))
|
||||
single_image_pil.save(single_file_path)
|
||||
|
||||
with open(single_file_path, "rb") as file:
|
||||
encoded_image = base64.b64encode(file.read()).decode("utf-8")
|
||||
if attach_image:
|
||||
@@ -80,10 +113,14 @@ class UploadToPushOver:
|
||||
webhook_url,
|
||||
data=parsed_data
|
||||
)
|
||||
|
||||
else:
|
||||
response = requests.post(
|
||||
webhook_url,
|
||||
data=parsed_data
|
||||
)
|
||||
# Response output
|
||||
if response.status_code == 200 or response.status_code == 201 or response.status_code == 204:
|
||||
print("✅ Successfully uploaded to Webhook.")
|
||||
print("✅ Successfully uploaded to Pushover.")
|
||||
print(f"Response Code: {response.status_code}")
|
||||
print(f"Response Text: {response.text}")
|
||||
else:
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
**Version 1.2.0**
|
||||
-- support for stored credentials.
|
||||
-- accept anything input
|
||||
>> this make you able to connect any output node to start send the notification
|
||||
>>> If you want to include image in the notification then just connect an image output line to the images input.
|
||||
|
||||
**Version 1.0.1**
|
||||
Initial release
|
||||
@@ -0,0 +1,3 @@
|
||||
# specify app key and user/group key if you don't want to set it up in the comfyUI node everytime
|
||||
apptoken=your-app-token-here
|
||||
usertoken=your-user-or-group-token-here
|
||||
|
After Width: | Height: | Size: 227 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 83 KiB |
@@ -1,15 +1,15 @@
|
||||
[project]
|
||||
name = "UploadToWebhookPushOver"
|
||||
description = "Send generated image to PushOver API webhook choose for only notification or add the image result as well."
|
||||
version = "1.0.1"
|
||||
license = {file = "LICENSE"}
|
||||
name = "UploadToPushOver"
|
||||
description = "Send generated image to PushOver API webhook choose for only notification or add the image result as well. It can connect to anything if you just want a notification somewhere in your workflow"
|
||||
version = "1.2.2"
|
||||
license = { file = "LICENSE"}
|
||||
dependencies = ["numpy", "requests", "Pillow"]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/MijnSpam/ComfyUI_UploadToWebhookPushOver"
|
||||
Repository = "https://github.com/MijnSpam/UploadToPushOver"
|
||||
# Used by Comfy Registry https://comfyregistry.org
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "MijnSpam"
|
||||
DisplayName = "ComfyUI_UploadToPushOver"
|
||||
|
||||
PublisherId = "kbrambo"
|
||||
DisplayName = "Upload to PushOver"
|
||||
Icon = "https://github.com/MijnSpam/UploadToPushOver/blob/main/images/icon.png?raw=true"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
## 🔧 Update v1.0.x to v1.2.0
|
||||
|
||||
1. In the custom nodes manager
|
||||
find your installed ComfyUI_UploadToPushOver node.
|
||||
Hit try update:
|
||||

|
||||
2. It can happen that your Manager doesn't report to restart, if so hit the restart button from the manager menu.
|
||||

|
||||
__It could also be that a restart is already happening in the backgroud__.
|
||||
3. Refresh your browser.
|
||||
|
||||
4. Due redesign of the node it's best to re-add it into your workflow as connect_anything is now mandatory and the images input isn't.
|
||||