initial upload
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
name: Publish to Comfy registry
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "pyproject.toml"
|
||||
|
||||
jobs:
|
||||
publish-node:
|
||||
name: Publish Custom Node to registry
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Publish Custom Node
|
||||
uses: Comfy-Org/publish-node-action@main
|
||||
with:
|
||||
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} ## Add your own personal access token to your Github Repository secrets and reference it here.
|
||||
@@ -1,2 +1,14 @@
|
||||
# ComfyUI-Riffusion
|
||||
Riffusion extension for ComfyUI to generate audio from text
|
||||
|
||||
A ComfyUI extension for Riffusion audio generation.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clone this repository into your `ComfyUI/custom_nodes` directory:
|
||||
```git clone https://github.com/your-username/ComfyUI-Riffusion```
|
||||
|
||||
2. Restart ComfyUI
|
||||
|
||||
## Usage
|
||||
|
||||
The extension adds a new node "Riffusion" under the audio category.
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
import sys
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
### GET PACKAGES ###
|
||||
def packages(versions=False):
|
||||
try:
|
||||
result = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'], stderr=subprocess.STDOUT)
|
||||
lines = result.decode().splitlines()
|
||||
return [line if versions else line.split('==')[0] for line in lines]
|
||||
except subprocess.CalledProcessError as e:
|
||||
print("An error occurred while fetching packages:", e.output.decode())
|
||||
return []
|
||||
|
||||
### INSTALL PACKAGE ###
|
||||
def install_package(package):
|
||||
print(f"Installing package {package}...")
|
||||
subprocess.check_call([sys.executable, '-s', '-m', 'pip', '-q', 'install', package])
|
||||
|
||||
### READ REQUIREMENTS ###
|
||||
def read_requirements():
|
||||
req_file = Path(__file__).parent / 'requirements.txt'
|
||||
if not req_file.exists():
|
||||
return []
|
||||
with open(req_file, 'r') as f:
|
||||
return [line.strip().split('>=')[0] for line in f if line.strip() and not line.startswith('#')]
|
||||
|
||||
### Ensure all required packages are installed ###
|
||||
installed_packages = packages()
|
||||
required_packages = read_requirements()
|
||||
|
||||
for package in required_packages:
|
||||
if package.lower() not in [pkg.lower() for pkg in installed_packages]:
|
||||
install_package(package)
|
||||
|
||||
### Don't import nodes until all packages are installed ###
|
||||
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
|
||||
|
||||
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
|
||||
@@ -0,0 +1,42 @@
|
||||
import io
|
||||
import typing as T
|
||||
import os
|
||||
import numpy as np
|
||||
from PIL import Image, ImageDraw
|
||||
from scipy.io import wavfile
|
||||
import torch
|
||||
import torchaudio
|
||||
from pedalboard.io import AudioFile
|
||||
import glob
|
||||
import wave
|
||||
|
||||
MAX_BATCH_SIZE = 8
|
||||
|
||||
class RiffusionNode:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
'spectrogram': ("IMAGE",),
|
||||
'output_type': ("STRING", {"default": "audio/wav"}),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
FUNCTION = "process"
|
||||
CATEGORY = "audio"
|
||||
|
||||
def process(self, spectrogram, output_type):
|
||||
# Your processing logic here
|
||||
pass
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"RiffusionNode": RiffusionNode
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"RiffusionNode": "Riffusion"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
[project]
|
||||
name = "riffusion"
|
||||
description = "A ComfyUI extension for Riffusion audio generation."
|
||||
version = "1.0.0"
|
||||
license = {file = "LICENSE"}
|
||||
dependencies = ["numpy>=1.21.0", "Pillow>=9.0.0", "scipy>=1.7.0", "torch>=1.9.0", "torchaudio>=0.9.0", "pedalboard>=0.7.0"]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/traugdor/ComfyUI-Riffusion"
|
||||
# Used by Comfy Registry https://comfyregistry.org
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "traugdor"
|
||||
DisplayName = "ComfyUI-Riffusion"
|
||||
Icon = ""
|
||||
@@ -0,0 +1,6 @@
|
||||
numpy>=1.21.0
|
||||
Pillow>=9.0.0
|
||||
scipy>=1.7.0
|
||||
torch>=1.9.0
|
||||
torchaudio>=0.9.0
|
||||
pedalboard>=0.7.0
|
||||
Reference in New Issue
Block a user