huchenlei / ComfyUI_omost

ComfyUI implementation of Omost
Apache License 2.0
407 stars 28 forks source link

About saving prompt words #46

Open smae08 opened 3 months ago

smae08 commented 3 months ago

Due to the slow speed of generating prompt words in Omost, I want to save the prompt words to a txt file, then read the file into a string, and pass it to Omost Load Canvas Conditioning. However, it prompts an error. What is the reason for this,

关于提示词保存  由于omost生成提示词速度太慢,我想将提示词保存到txt文件中,然后再读取文件到字符串,再传给Omost Load Canvas Conditioning,但是他提示错误,这个是什么原因,

huchenlei commented 3 months ago

Please attach error message and the input you used.

smae08 commented 3 months ago

Error occurred when executing OmostLoadCanvasConditioningNode:

Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

File "G:\ComfyUI_FK_2024\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "G:\ComfyUI_FK_2024\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "G:\ComfyUI_FK_2024\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "G:\ComfyUI_FK_2024\ComfyUI\custom_nodes\ComfyUI_omost\omost_nodes.py", line 688, in load_canvas return (json.loads(json_str),) File "json__init__.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 353, in raw_decode

smae08 commented 3 months ago

txt file

{'rect': (0, 90, 0, 90), 'prefixes': ['A little squirrel.'], 'suffixes': ['The image features a small, adorable squirrel.', 'The squirrel is sitting on a tree branch, surrounded by lush green foliage and vibrant flowers.', 'The sky is a bright blue with a few fluffy white clouds.', 'The squirrel has a bushy tail and its fur is a mix of brown and white.', 'Its eyes are bright and curious, and it appears to be looking around its surroundings.', 'The overall atmosphere is serene and peaceful, with a sense of natural beauty and tranquility.', 'The image captures the essence of a typical day in a forest, filled with life and the simple joys of nature.', 'squirrel, tree branch, foliage, flowers, blue sky, white clouds, bushy tail, brown fur, white fur, curious eyes, serene, peaceful, natural beauty, tranquility, forest, life, nature, day, simple joys.'], 'color': (34, 139, 34)}, {'color': (135, 206, 235), 'rect': [0, 45, 0, 80], 'prefixes': ['A little squirrel.', 'Bright blue sky.'], 'suffixes': ['The sky at the top of the image is a bright blue, with a few fluffy white clouds scattered across it.', 'The blue color is vibrant and clear, indicating a beautiful day in the forest.', 'The clouds are soft and white, adding a touch of whimsy to the otherwise clear sky.', 'The sunlight bathes the entire scene in a warm, golden glow, enhancing the colors of the foliage and flowers.', 'The bright blue sky adds a sense of openness and freedom to the image, making the forest feel expansive and inviting.', 'sky, bright blue, fluffy white clouds, vibrant, clear, beautiful day, whimsical, sunlight, warm glow, golden, colors, openness, freedom, expansive, inviting, forest.', 'The bright blue sky adds a sense of openness and freedom to the image.', 'The sky is depicted with a focus on its vibrant blue color and fluffy clouds.', 'The sky is rendered with high detail and vibrant colors.']}, {'color': (139, 69, 19), 'rect': [50, 90, 0, 40], 'prefixes': ['A little squirrel.', 'Tree trunk.'], 'suffixes': ['The tree trunk on the bottom-left of the image is thick and sturdy, with a rough texture that indicates age and strength.', 'The bark is a deep brown color, with patches of moss and lichen adding to its rustic appearance.', 'The trunk is partially covered in moss, and small roots extend from its base, digging into the forest floor.', 'The tree trunk adds a sense of stability and permanence to the image, grounding the scene in the natural world.', 'The sunlight filters through the leaves above, casting shadows on the trunk and creating a play of light and dark.', 'tree trunk, thick, sturdy, rough texture, age, strength, deep brown, moss, lichen, rustic, stability, permanence, natural world, sunlight, shadows, light, dark.', 'The tree trunk adds a sense of stability and permanence to the image.', 'The tree trunk is depicted with a focus on its rough texture and rustic appearance.', 'The tree trunk is rendered with high detail and realistic textures.']}, {'color': (34, 139, 34), 'rect': [0, 75, 0, 40], 'prefixes': ['A little squirrel.', 'Lush green foliage.'], 'suffixes': ['The foliage on the left side of the image is vibrant and lush, consisting of various types of leaves.', 'The green hues range from deep emerald to lighter shades, creating a rich and varied texture.', 'The leaves are large and have a glossy appearance, indicating that they are healthy and well-nourished.', 'The foliage adds a sense of depth and richness to the image, making the forest feel alive and thriving.', 'The sunlight filters through the leaves, casting dappled shadows on the ground below.', 'foliage, green leaves, vibrant, lush, emerald, glossy leaves, healthy, well-nourished, depth, richness, alive, thriving, sunlight, shadows.', 'The foliage adds a sense of depth and richness to the image.', 'The foliage is depicted with a focus on its vibrant colors and glossy texture.', 'The foliage is rendered with high detail and vibrant colors.']}, {'color': (255, 0, 0), 'rect': [15, 90, 50, 90], 'prefixes': ['A little squirrel.', 'Vibrant flowers.'], 'suffixes': ['The flowers on the right side of the image are vibrant and colorful, adding a splash of color to the green foliage.', 'The flowers are a mix of different species, with petals ranging in color from bright reds to soft pinks and yellows.', 'The petals are delicate and appear to be gently swaying in the breeze.', 'The stems are slender and green, supporting the flowers as they reach towards the sky.', 'The flowers add a sense of beauty and life to the image, enhancing the overall tranquility of the forest scene.', 'flowers, vibrant, colorful, green foliage, different species, bright reds, soft pinks, yellows, delicate petals, swaying, slender stems, beauty, life, tranquility, forest.', 'The flowers add a sense of beauty and life to the image.', 'The flowers are depicted with a focus on their vibrant colors and delicate petals.', 'The flowers are rendered with high detail and vibrant colors.']}, {'color': (139, 69, 19), 'rect': [15, 75, 15, 75], 'prefixes': ['A little squirrel.', 'A small squirrel.'], 'suffixes': ['The squirrel is the focal point of the image.', 'It sits comfortably on a tree branch, its bushy tail curled around it.', "The squirrel's fur is a mix of brown and white, giving it a soft and fluffy appearance.", 'Its eyes are large and bright, full of curiosity as it looks around.', "The squirrel's tiny paws grip the branch gently, and it seems to be enjoying the view of its surroundings.", 'The overall impression of the squirrel is one of cuteness and charm, embodying the innocence and playfulness of forest life.', 'squirrel, tree branch, bushy tail, brown fur, white fur, large eyes, bright eyes, curious, tiny paws, cute, charming, innocence, playfulness, forest life.', 'The atmosphere around the squirrel is one of innocence and playfulness.', 'The squirrel is depicted with a focus on its cuteness and charm.', 'The squirrel is rendered with high detail and clarity.']}

smae08 commented 3 months ago

cccc.json

huchenlei commented 3 months ago

replace ' with " in that JSON file

smae08 commented 3 months ago

{"rect": (0, 90, 0, 90), "prefixes": ["A beautiful woman holding a small panda cub and sitting beside an adorable Husky, with a realistic photo effect like a movie still."], "suffixes": ["The image depicts a beautiful woman who is holding a small panda cub in her arms.", "She has a gentle smile on her face, exuding warmth and tenderness.", "Beside her sits an adorable Husky, looking up with its big brown eyes full of curiosity and affection.", "The scene is set outdoors, possibly in a park or nature reserve, which adds to the natural feel of the image.", "The lighting is soft and natural, enhancing the realism and warmth of the photograph.", "beautiful woman, small panda cub, Husky, realistic photo effect, movie still, gentle smile, warmth, tenderness, outdoors, park, nature reserve, natural lighting, soft light, big brown eyes, curiosity, affection."], "color": (135, 206, 250)}, {"color": (135, 206, 250), "rect": [5, 45, 0, 55], "prefixes": ["A beautiful woman holding a small panda cub and sitting beside an adorable Husky, with a realistic photo effect like a movie still.", "A background featuring park or nature reserve scenery."], "suffixes": ["The backdrop of this image is a serene park or nature reserve, with lush greenery and tall trees providing a natural and peaceful ambiance.", "There"s a soft blur effect to the background, ensuring that it doesn"t distract from the main subjects but still adds depth and context to the scene.", "park scenery, nature reserve, lush greenery, tall trees, serene backdrop, natural ambiance, peaceful setting, background blur.", "Serene and natural, enhancing the overall warmth of the image.", "Realistic photo effect with a soft blur on the background to add depth.", "High-resolution image with detailed textures in the background elements."]}, {"color": (135, 206, 250), "rect": [25, 85, 35, 90], "prefixes": ["A beautiful woman holding a small panda cub and sitting beside an adorable Husky, with a realistic photo effect like a movie still.", "An adorable Husky sitting beside the woman."], "suffixes": ["The Husky is a striking presence in this image, with its thick fur and expressive eyes.", "It"s seated just slightly to the lower-left of the woman’s right side.", "Its fur is a blend of white, gray, and black, giving it a majestic yet approachable appearance.", "The Husky looks up at the woman with curiosity and affection, adding an element of interaction and warmth to the scene.", "Husky, thick fur, expressive eyes, white fur, gray fur, black fur, majestic, approachable, curious look, affectionate.", "Playful yet calm, enhancing the overall warmth of the image.", "Realistic photo capturing the Husky"s majestic and playful nature.", "High-quality image with clear details in fur texture and eye expression."]}, {"color": (135, 206, 250), "rect": [15, 75, 15, 75], "prefixes": ["A beautiful woman holding a small panda cub and sitting beside an adorable Husky, with a realistic photo effect like a movie still.", "A beautiful woman holding a small panda cub."], "suffixes": ["The woman is at the heart of this image, exuding grace and beauty.", "She has long flowing hair, which frames her face perfectly.", "Her attire is casual yet stylish, suitable for an outdoor setting.", "In her arms she cradles a small panda cub, its black and white fur standing out against her skin tone.", "The woman’s facial expression shows tenderness as she gazes lovingly at the panda cub.", "beautiful woman, holding panda cub, long flowing hair, casual attire, stylish, outdoor setting, black and white fur, tender expression.", "Warm and tender with a natural outdoor feel.", "Realistic photo effect capturing the scene"s warmth.", "High-resolution image with detailed textures and lifelike colors."]}

smae08 commented 3 months ago

!!! Exception during processing!!! Expecting value: line 1 column 10 (char 9)

Traceback (most recent call last): File "G:\ComfyUI_FK_2024\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "G:\ComfyUI_FK_2024\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "G:\ComfyUI_FK_2024\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "G:\ComfyUI_FK_2024\ComfyUI\custom_nodes\ComfyUI_omost\omost_nodes.py", line 688, in load_canvas return (json.loads(json_str),) File "json__init__.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 10 (char 9)

smae08 commented 3 months ago

Still reporting an error

smae08 commented 3 months ago

I know, there is a problem with my node that can be converted into a string at will。 Is there a node that provides the correct conversion to a string