Skip to content

Commit

Permalink
[UPDATE] 1. just input image not need covert into base64 first.
Browse files Browse the repository at this point in the history
2. convert IMAGE tensor to PIL image then base64 inside node.
3. save temp file is telegram required
  • Loading branch information
xlinx committed Aug 24, 2024
1 parent 8502d74 commit bacee72
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@
<tr>
<td colspan="2"><img src="images/rm_use2.png"></img></td>
</tr>
<tr>
<td colspan="2"><img src="images/rm_use3.png"></img></td>
</tr>
<tr>
<td colspan="2">
<b style="font-size:20px">ComfyUI Manager | search keyword: auto</b>
Expand Down
9 changes: 5 additions & 4 deletions auto_prompt_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def image_to_base64(image):
pli_image.save(image_data, format='PNG', pnginfo=None)
image_data_bytes = image_data.getvalue()
encoded_image = "data:image/png;base64," + base64.b64encode(image_data_bytes).decode('utf-8')
log.warning("[][image_to_base64][]"+encoded_image)
# log.warning("[][image_to_base64][]"+encoded_image)
return encoded_image


Expand Down Expand Up @@ -307,7 +307,7 @@ def INPUT_TYPES(cls):
return {
#https://docs.comfy.org/essentials/custom_node_more_on_inputs#hidden-inputs
"hidden": {
"image_to_llm_vision": ("*",),
"image_to_llm_vision": ("IMAGE",),
"llm_vision_max_token": ("INT", {"default": 50, "min": 10, "max": 1024, "step": 1}),
"llm_vision_tempture": ("FLOAT", {"default": 0.8, "min": -2.0, "max": 2.0, "step": 0.01}),
"llm_vision_system_prompt": (
Expand Down Expand Up @@ -406,11 +406,12 @@ def INPUT_TYPES(cls):
"llm_text_result_append_enabled": ([True, False],),
},
"optional": {
"image_to_llm_vision": ("*",),

},
"required": {

"clip": ("CLIP",),
# "image_to_llm_vision": ("STRING", {"multiline": True,}),
"image_to_llm_vision": ("IMAGE",),

"llm_vision_result_append_enabled": ([True, False],),

Expand Down
Binary file added images/rm_use3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-decadetw-auto-prompt-llm"
description = "NODES: Auto-LLM-Text-Vision, Auto-LLM-Text, Auto-LLM-Vision"
version = "1.0.0"
version = "1.0.1"
license = {file = "LICENSE"}

[project.urls]
Expand Down

0 comments on commit bacee72

Please sign in to comment.