21 Commits
Author SHA1 Message Date
Pascal Rössler 47ea4cedc9 Merge pull request #27 from Quasimondo/main
Update font2img_node.py
2024-05-29 20:29:05 +02:00
Mario Klingemann bb211a312e Update font2img_node.py
Added optional skip_first_frames to allow for batch processing of longer videos
2024-05-29 19:05:27 +02:00
Pascal Rössler fc9b0b6c98 Merge pull request #24 from Quasimondo/patch-1
Update font2img_node.py
2024-05-21 20:50:40 +02:00
Mario Klingemann 0c6ba0227f Update font2img_node.py
Fixed calculation of frame_number so the first frame starts at 1 (instead of 0)
2024-05-21 17:09:07 +02:00
Pascal Rössler c1b7356be4 Update README.md 2024-05-12 22:43:17 +02:00
Pascal Rössler 0b647966fd Merge pull request #22 from ForeignGods/dev
incremental textfile prefix save
2024-05-12 22:42:17 +02:00
Pascal Rössler c578055671 Update README.md 2024-04-28 19:33:12 +02:00
Pascal Rössler 7a60075cc8 Update README.md 2024-04-28 19:31:40 +02:00
Pascal Rössler 949e9d545d Merge pull request #20 from ForeignGods/dev
JS corrections, updated example
2024-04-28 19:26:27 +02:00
Pascal Rössler 265a4e80ee Update README.md 2024-04-28 19:23:57 +02:00
Pascal Rössler 094da69f6d Merge pull request #19 from ForeignGods/dev
fix js node names
2024-04-28 12:30:30 +02:00
Pascal Rössler 3aa790b773 Update README.md 2024-04-27 17:32:22 +02:00
Pascal Rössler de14afcb47 Update README.md 2024-04-27 17:30:39 +02:00
Pascal Rössler 42b577c966 Update README.md 2024-04-27 17:20:03 +02:00
Pascal Rössler 72935bb0db Update README.md 2024-04-27 17:11:01 +02:00
Pascal Rössler d774770ed6 Update README.md 2024-04-27 16:57:57 +02:00
Pascal Rössler bd04ca7e37 Update README.md 2024-04-27 16:56:20 +02:00
Pascal Rössler d0d23d2417 Update README.md 2024-04-27 16:48:16 +02:00
Pascal Rössler 2e0f99d0c0 Merge pull request #18 from ForeignGods/dev
Dev
2024-04-27 16:40:53 +02:00
Pascal Rössler 7f7769de15 Update requirements.txt 2024-03-28 14:43:40 +01:00
Pascal Rössler cdc9898fdd Merge pull request #15 from ForeignGods/dev
Organised directory structure
2024-03-17 18:55:40 +01:00
2 changed files with 62 additions and 29 deletions
+56 -25
View File
@@ -1,12 +1,24 @@
# ComfyUI-Mana-Nodes ![Static Badge](https://img.shields.io/badge/release-v1.0-black?style=plastic&logo=GitHub&logoColor=white&color=green) [![Downloads](https://img.shields.io/github/downloads/ForeignGods/ComfyUI-Mana-Nodes/total.svg)](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/releases)
![ezgif com-optimize(2)](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/assets/78089013/f48b37c2-c3db-408f-ada8-a6bf336b6549)
TODO: Add short intro and description to Mana Nodes here. And maybe animated or static logo MANA NODES instead of simple title.
![Static Badge](https://img.shields.io/badge/release-v1.0.0-black?style=plastic&logo=GitHub&logoColor=white&color=green)
[![Custom Badge](https://img.shields.io/badge/buy-coffe-orange?style=plastic&logo=buymeacoffee&logoColor=white&link=URL)](https://buymeacoffee.com/foreigngods)
<!--
<a href="https://github.com/ForeignGods/ComfyUI-Mana-Nodes/releases">
<img alt="GitHub all releases" src="https://img.shields.io/github/downloads/ForeignGods/ComfyUI-Mana-Nodes/latest/total">
</a>
-->
Welcome to the ComfyUI-Mana-Nodes project!
This collection of custom nodes is designed to supercharge text-based content creation within the ComfyUI environment.
Whether you're working on dynamic captions, transcribing audio, or crafting engaging visual content, Mana Nodes has got you covered.
If you like Mana Nodes, give our repo a [⭐ Star](https://github.com/ForeignGods/ComfyUI-Mana-Nodes) and [👀 Watch](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/subscription) our repository to stay updated.
## Installation
You can install these nodes via the [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager)
Simply clone the repo into the `custom_nodes` directory with this command:
You can install Mana Nodes via the [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager)
Or simply clone the repo into the `custom_nodes` directory with this command:
```
git clone https://github.com/ForeignGods/ComfyUI-Mana-Nodes.git
@@ -176,6 +188,9 @@ Used as input on ✒️ <b>Text to Image Generator</b> node to define the canvas
<details>
<summary>⏰ <b>Scheduled Values</b></summary>
![Screenshot 2024-04-27 at 17-07-10 ComfyUI](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/assets/78089013/ee456e65-9950-4138-8b37-23b007ec92d9)
#### Required Inputs
#### `frame_count`
@@ -430,7 +445,7 @@ Path to the created video file.
</details>
<details>
<summary>📣 <b>Generate Audio</b></summary>
<summary>📣 <b>Generate Audio</b> (experimental)</summary>
Converts text to speech and saves the output as an audio file.
@@ -502,9 +517,39 @@ Prefix for naming the text file. (relative to .\output)
</details>
## Example Workflows
### LCM AnimateDiff Text Animation
#### Demo
| Demo 1 | Demo 2 | Demo 3 |
| ------ | ------ | ------ |
|![demo1](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/assets/78089013/7b77b9cc-457f-4061-ac6c-2f78efb8bffc)|![demo2](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/assets/78089013/89bc4309-6c46-4d08-9d9c-521e00415e65)|![demo3](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/assets/78089013/ae2e09c5-459c-4b4d-ad71-4db31684573f)|
#### Workflow
[example_workflow_1.json](example_workflows/example_workflow_1.json)
The values for the ⏰ Scheduled Values node cannot be imported yet (you have to add them yourself).
![Screenshot 2024-04-28 at 19-18-01 ComfyUI](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/assets/78089013/fa739ab0-91e5-4df7-9bd9-727abb6fb86a)
### Speech Recognition Caption Generator
#### Demo
Turn on audio.
https://github.com/ForeignGods/ComfyUI-Mana-Nodes/assets/78089013/e5a39327-db61-46ad-abea-10e27e4551c1
#### Workflow
[example_workflow_2.json](example_workflows/example_workflow_2.json)
![TRANSCRIPTION](https://github.com/ForeignGods/ComfyUI-Mana-Nodes/assets/78089013/e4d6aa73-3a4b-483e-b763-73b88c8cb261)
## To-Do
- [ ] Improve Speech Recognition
@@ -514,26 +559,12 @@ Prefix for naming the text file. (relative to .\output)
- [ ] Text to Image Generator Alpha Channel
- [ ] Add Font Support for non Latin Characters
- [ ] 3D Effects, Bevel/Emboss, Inner Shading, Fade in/out
## Font Licences
- <b>Personal Use:</b> The included fonts are for personal, non-commercial use. Please refrain from using these fonts in any commercial project without obtaining the appropriate licenses.
- <b>License Compliance:</b> Each font may come with its own license agreement. It is the responsibility of the user to review and comply with these agreements. Some fonts may require a license for commercial use, modification, or distribution.
- <b>Removing Fonts:</b> If any font creator or copyright holder wishes their font to be removed from this repository, please contact us, and we will promptly comply with your request.
### Font Links
- https://www.dafont.com/akira-expanded.font
- https://www.dafont.com/aurora-pro.font
- https://www.dafont.com/another-danger.font
- https://www.dafont.com/doctor-glitch.font
- https://www.dafont.com/ghastly-panic.font
- https://www.dafont.com/metal-gothic.font
- https://www.dafont.com/the-constellation.font
- https://www.dafont.com/the-augusta.font
- https://www.dafont.com/vogue.font
- https://www.dafont.com/wreckside.font
- [ ] Find a better way to define color animations
- [ ] Make more Font Properties animatable
## Contributing
<a href="https://www.buymeacoffee.com/foreigngods" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
Your contributions to improve Mana Nodes are welcome! If you have suggestions or enhancements, feel free to fork this repository, apply your changes, and create a pull request. For significant modifications or feature requests, please open an issue first to discuss what you'd like to change.
Your contributions to improve Mana Nodes are welcome!
If you have suggestions or enhancements, feel free to fork this repository, apply your changes, and create a pull request. For significant modifications or feature requests, please open an issue first to discuss what you'd like to change.
+6 -4
View File
@@ -67,6 +67,7 @@ class font2img:
"optional": {
"transcription": ("TRANSCRIPTION", {"default": None,"forceInput": True}),
"highlight_font": ("TEXT_GRAPHIC_ELEMENT", {"default": None,"forceInput": True}),
"skip_first_frames": ("INT", {"default": 0, "min": 0, "step": 1, "display": "number"}),
}
}
@@ -111,7 +112,7 @@ class font2img:
sentence_frame_numbers = []
for i, (word, start_time, end_time) in enumerate(transcription_data):
frame_number = round(start_time * transcription_fps)
frame_number = 1 + round(start_time * transcription_fps)
if not current_sentence:
current_sentence = word
@@ -660,7 +661,8 @@ class font2img:
structured_format = False
frame_text_dict = {}
frame_count = kwargs['frame_count']
skip_first_frames = kwargs.get('skip_first_frames', 0)
# Filter out empty lines
lines = [line for line in text.split('\n') if line.strip()]
@@ -670,7 +672,7 @@ class font2img:
for line in lines:
parts = line.split(':', 1)
if len(parts) == 2:
frame_number = parts[0].strip().replace('"', '')
frame_number = str(int(parts[0].strip().replace('"', ''))-skip_first_frames)
text = parts[1].strip().replace('"', '').replace(',', '')
frame_text_dict[frame_number] = text
else:
@@ -737,4 +739,4 @@ class font2img:
return Image.new('RGB', (image_width, image_height), color=background_color_tuple)
else:
background_color_tuple = ImageColor.getrgb(background_color)
return Image.new('RGB', (image_width, image_height), color=background_color_tuple)
return Image.new('RGB', (image_width, image_height), color=background_color_tuple)