mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-22 15:59:45 +08:00
Slightly rework the choices module interface.
This commit is contained in:
parent
9bc8b5ce44
commit
9aa915045a
@ -15,7 +15,7 @@ class LogicError(Exception):
|
||||
def get_seed():
|
||||
return int.from_bytes(os.urandom(8), byteorder='big')
|
||||
|
||||
def translate_choices(text, seed=None):
|
||||
def translate(text, seed=None):
|
||||
'''
|
||||
Parses the text, translating "{A|B|C}" choices into a single choice.
|
||||
An option is chosen randomly from the available options.
|
||||
|
||||
4
nodes.py
4
nodes.py
@ -14,7 +14,7 @@ from PIL.PngImagePlugin import PngInfo
|
||||
import numpy as np
|
||||
import safetensors.torch
|
||||
|
||||
from comfy.choices import translate_choices
|
||||
import comfy.choices
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy"))
|
||||
|
||||
@ -1479,7 +1479,7 @@ class DynamicPrompt:
|
||||
CATEGORY = "conditioning"
|
||||
|
||||
def dynamic_prompt(self, text, seed):
|
||||
translated_prompt_text = translate_choices(text, seed)
|
||||
translated_prompt_text = comfy.choices.translate(text, seed)
|
||||
return (translated_prompt_text,)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user