Workflow ComfyUi - Create a Hugging and Kissing Video from a Photo
詳細
ファイルをダウンロード
モデル説明
このモデルは、2人の写真が与えられたときに彼らが抱き合うことができるワークフローです。これは、T8star-AixがRunninghubで公開したワークフローの不具合部分を修正して作成されました。
削除を求められれば、すぐに削除します。
変更点は、画像クロッパーノードを置き換えた動画に示されており、以下のようにコード内のエラーも修正されています:
2025-03-28T08:24:10.310732 - Traceback (最近の呼び出し順):
File "/ComfyUI/execution.py", line 327, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
File "/ComfyUI/execution.py", line 202, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
File "/ComfyUI/execution.py", line 174, in _map_node_over_list
process_inputs(input_dict, i)
File "/ComfyUI/execution.py", line 163, in process_inputs
results.append(getattr(obj, func)(**inputs))
File "/ComfyUI/custom_nodes/comfyui_ttp_toolset/TTP_toolsets.py", line 704, in expand_and_mask
fill_rgba = self.hex_to_rgba(fill_color)
File "/ComfyUI/custom_nodes/comfyui_ttp_toolset/TTP_toolsets.py", line 559, in hex_to_rgba
raise ValueError("Invalid hex color format")
ValueError: Invalid hex color format
2025-03-28T08:24:10.310997 - プロンプトの実行に8.00秒かかりました
このエラーの解決策:
expand_and_mask 関数が呼び出されている場所を確認してください:
TTP_[toolsets.py](http://toolsets.py) の704行目で fill_color 変数を定義してください。
この値が無効なHEXコードかどうかを確認してください:
HEXカラーコードは通常、#RRGGBB または #RRGGBBAA の形式です(例:#FF5733 または #FF5733FF)。
fill_color が誤った形式(#FF573、123456、red など)の場合、このエラーが発生します。
hex_to_rgba 関数内でHEX形式を検証してください。
TTP_[toolsets.py](http://toolsets.py) の559行目の hex_to_rgba 関数を更新してください:
以下のような正規表現チェックを追加できます:
コードを以下のように変更してください:
import re
def hex_to_rgba(self, hex_color):
# 先頭の '#' を削除
hex_color = hex_color.lstrip('#')
# HEX形式が有効か確認
if not re.match(r'^[A-Fa-f0-9]{6}$|^[A-Fa-f0-9]{8}$', hex_color):
raise ValueError(f"Invalid hex color format: {hex_color}. Expected format is #RRGGBB or #RRGGBBAA.")
# 6文字の場合、アルファ値をデフォルト255(不透明)として返す
if len(hex_color) == 6:
r = int(hex_color[0:2], 16)
g = int(hex_color[2:4], 16)
b = int(hex_color[4:6], 16)
return (r, g, b, 255)
# 8文字の場合、最後の2文字がアルファ(透明度)値
elif len(hex_color) == 8:
r = int(hex_color[0:2], 16)
g = int(hex_color[2:4], 16)
b = int(hex_color[4:6], 16)
a = int(hex_color[6:8], 16)
return (r, g, b, a)
else:
raise ValueError(f"Invalid hex color format: {hex_color}")