Add files via upload

This commit is contained in:
Doctor Diffusion
2024-11-23 15:09:35 -05:00
committed by GitHub
parent 61f087f5e3
commit 6451b804fe
2 changed files with 58 additions and 6 deletions
+13 -6
View File
@@ -13,20 +13,27 @@ from .youtube_video_downloader import (
NODE_CLASS_MAPPINGS as YOUTUBE_VIDEO_DOWNLOADER_MAPPINGS,
NODE_DISPLAY_NAME_MAPPINGS as YOUTUBE_VIDEO_DOWNLOADER_DISPLAY_MAPPINGS
)
from .video_prompt_generator import (
VideoPromptGenerator,
NODE_CLASS_MAPPINGS as VIDEO_PROMPT_GENERATOR_MAPPINGS,
NODE_DISPLAY_NAME_MAPPINGS as VIDEO_PROMPT_GENERATOR_DISPLAY_MAPPINGS
from .reverse_frame_sequence import (
ReverseFrameSequence,
NODE_CLASS_MAPPINGS as REVERSE_FRAME_SEQUENCE_MAPPINGS,
NODE_DISPLAY_NAME_MAPPINGS as REVERSE_FRAME_SEQUENCE_DISPLAY_MAPPINGS
)
from .prompt_journal import (
PromptJournal,
NODE_CLASS_MAPPINGS as PROMPT_JOURNAL_MAPPINGS,
NODE_DISPLAY_NAME_MAPPINGS as PROMPT_JOURNAL_DISPLAY_MAPPINGS
)
NODE_CLASS_MAPPINGS = {
**FINAL_FRAME_SELECTOR_MAPPINGS,
**VIDEO_MERGE_MAPPINGS,
**YOUTUBE_VIDEO_DOWNLOADER_MAPPINGS,
**VIDEO_PROMPT_GENERATOR_MAPPINGS
**REVERSE_FRAME_SEQUENCE_MAPPINGS,
**PROMPT_JOURNAL_MAPPINGS
}
NODE_DISPLAY_NAME_MAPPINGS = {
**FINAL_FRAME_SELECTOR_DISPLAY_MAPPINGS,
**VIDEO_MERGE_DISPLAY_MAPPINGS,
**YOUTUBE_VIDEO_DOWNLOADER_DISPLAY_MAPPINGS,
**VIDEO_PROMPT_GENERATOR_DISPLAY_MAPPINGS
**REVERSE_FRAME_SEQUENCE_DISPLAY_MAPPINGS,
**PROMPT_JOURNAL_DISPLAY_MAPPINGS
}
+45
View File
@@ -0,0 +1,45 @@
class PromptJournal:
def __init__(self):
self.prompts = [""]
self.prompt_number = 0
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"prompts": ("STRING", {"multiline": True, "default": ""}),
"prompt_number": ("INT", {"default": 0, "min": 0, "step": 1}),
},
}
RETURN_TYPES = ("STRING", "STRING")
FUNCTION = "process"
CATEGORY = "MediaMixer"
def process(self, prompts, prompt_number):
self.prompts = prompts.split('\n')
self.prompt_number = prompt_number
# Filter out empty rows for prompt selection
non_empty_prompts = [prompt for prompt in self.prompts if prompt.strip()]
# Wrap around the prompt_number if it's too high
effective_prompt_number = self.prompt_number % len(non_empty_prompts)
# Get the selected prompt
prompt = non_empty_prompts[effective_prompt_number]
# Join all prompts back into a single string, keeping empty rows
all_prompts = '\n'.join(self.prompts)
return (prompt, all_prompts)
# A dictionary that contains all nodes you want to export with their names
NODE_CLASS_MAPPINGS = {
"PromptJournal": PromptJournal
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"PromptJournal": "Prompt Journal"
}