[feat] how to connect the color option, is there any example?
Closed this issue · 6 comments
Describe the problem
I have no idea about how to connect the color input option when use the colored image(mtb) node.
And the example gived havn't the color input option.
Describe the solution you'd like
Can you provide some examples of using color input items
Alternatives considered
No response
Additional context
No response
It seems like the web modules did not load, what OS are you on and how did you install mtb?
It seems like the web modules did not load, what OS are you on and how did you install mtb?
windows 10, install mtb by ComfyUI-Manager
3ks. i fixed the problem with
# - REGISTER WEB EXTENSIONS
web_extensions_root = comfy_dir / "web" / "extensions"
web_mtb = web_extensions_root / "mtb"
if web_mtb.exists():
log.debug(f"Web extensions folder found at {web_mtb}")
elif web_extensions_root.exists():
try:
os.symlink((here / "web"), web_mtb.as_posix())
except Exception: # OSError
log.error(
f"Failed to create symlink to {web_mtb}. Please copy the folder manually."
)
else:
log.error(
f"Comfy root probably not found automatically, please copy the folder {web_mtb} manually in the web/extensions folder of ComfyUI"
)
3ks. i fixed the problem with ``` # - REGISTER WEB EXTENSIONS web_extensions_root = comfy_dir / "web" / "extensions" web_mtb = web_extensions_root / "mtb"
if web_mtb.exists(): log.debug(f"Web extensions folder found at {web_mtb}") elif web_extensions_root.exists(): try: os.symlink((here / "web"), web_mtb.as_posix()) except Exception: # OSError log.error( f"Failed to create symlink to {web_mtb}. Please copy the folder manually." ) else: log.error( f"Comfy root probably not found automatically, please copy the folder {web_mtb} manually in the web/extensions folder of ComfyUI" )```
but when i run, there is a new error:
Error occurred when executing Colored Image (mtb):
module 'PIL.Image' has no attribute 'ANTIALIAS'
File "E:\workplace\dev\image_work\ComfyUI\execution.py", line 154, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\workplace\dev\image_work\ComfyUI\execution.py", line 84, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\workplace\dev\image_work\ComfyUI\execution.py", line 77, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\workplace\dev\image_work\ComfyUI\custom_nodes\comfy_mtb\nodes\image_processing.py", line 523, in render_img
fg_image = self.resize_and_crop(fg_image, image.size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\workplace\dev\image_work\ComfyUI\custom_nodes\comfy_mtb\nodes\image_processing.py", line 478, in resize_and_crop
img = img.resize(new_size, Image.ANTIALIAS)
^^^^^^^^^^^^^^^
3ks. i fixed the problem with
# - REGISTER WEB EXTENSIONS web_extensions_root = comfy_dir / "web" / "extensions" web_mtb = web_extensions_root / "mtb" if web_mtb.exists(): log.debug(f"Web extensions folder found at {web_mtb}") elif web_extensions_root.exists(): try: os.symlink((here / "web"), web_mtb.as_posix()) except Exception: # OSError log.error( f"Failed to create symlink to {web_mtb}. Please copy the folder manually." ) else: log.error( f"Comfy root probably not found automatically, please copy the folder {web_mtb} manually in the web/extensions folder of ComfyUI" )
but when i run, there is a new error: Error occurred when executing Colored Image (mtb):
module 'PIL.Image' has no attribute 'ANTIALIAS'
File "E:\workplace\dev\image_work\ComfyUI\execution.py", line 154, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\workplace\dev\image_work\ComfyUI\execution.py", line 84, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\workplace\dev\image_work\ComfyUI\execution.py", line 77, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\workplace\dev\image_work\ComfyUI\custom_nodes\comfy_mtb\nodes\image_processing.py", line 523, in render_img fg_image = self.resize_and_crop(fg_image, image.size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\workplace\dev\image_work\ComfyUI\custom_nodes\comfy_mtb\nodes\image_processing.py", line 478, in resize_and_crop img = img.resize(new_size, Image.ANTIALIAS) ^^^^^^^^^^^^^^^
then i downgrade pillow version to 9.5.0 and the problem solved
Thanks for the details, I will check for a fix on the last pillow version