Add files via upload
This commit is contained in:
+13
-6
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user