-
-
Save safa-dayo/7dbefdf734e40040d9dc43cfa76e28e6 to your computer and use it in GitHub Desktop.
#@title FramePack-eichi を Colab で動かすためのスクリプト | |
# URL: https://github.com/git-ai-code/FramePack-eichi | |
# Setup FramePack | |
%cd /content | |
!git clone https://github.com/lllyasviel/FramePack.git | |
%cd FramePack | |
# Setup FramePack-eichi | |
!git clone https://github.com/git-ai-code/FramePack-eichi.git /content/FramePack-eichi | |
!mkdir webui | |
!cp -r /content/FramePack-eichi/webui/* ./webui/ | |
!cp -r diffusers_helper ./webui/ | |
!cp -r /content/FramePack-eichi/webui/diffusers_helper ./webui/ | |
# Install dependencies | |
!pip install --upgrade --pre torch torchvision torchaudio \ | |
--index-url https://download.pytorch.org/whl/cu126 | |
!pip install -r requirements.txt | |
!pip install xformers==0.0.26.post2 -q | |
!pip install sageattention==1.0.6 -q | |
# Start WebUI | |
# Linux/Colab では存在しない WindowsSelectorEventLoopPolicy を呼ばないように修正 | |
!sed -i \ | |
"s/asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())/import sys\\nif sys.platform.startswith('win'):\\n asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())/" \ | |
/content/FramePack/webui/endframe_ichi.py | |
!sed -i \ | |
"s/asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())/import sys\\nif sys.platform.startswith('win'):\\n asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())/" \ | |
/content/FramePack/webui/endframe_ichi_f1.py | |
!sed -i \ | |
"s/asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())/import sys\\nif sys.platform.startswith('win'):\\n asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())/" \ | |
/content/FramePack/webui/oneframe_ichi.py | |
# ==== F1のNameError対策 ==== | |
!sed -i '1i\from eichi_utils import lora_state_cache' /content/FramePack/webui/endframe_ichi_f1.py | |
#@markdown --- | |
#@markdown ### 実行するUIを選択 | |
command_to_run = "通常モード" #@param ["通常モード", "F1モード", "お壱モード"] | |
if command_to_run == "通常モード": | |
print("通常モードで実行します。") | |
!python webui/endframe_ichi.py --lang ja --share | |
elif command_to_run == "F1モード": | |
print("F1モードで実行します。") | |
!python webui/endframe_ichi_f1.py --lang ja --share | |
elif command_to_run == "お壱モード": | |
print("お壱モードで実行します。") | |
!python webui/oneframe_ichi.py --lang ja --share | |
else: | |
print("有効なコマンドが選択されていません。") |
@armpitranger 手元で試したところ、問題なく生成ができるようでした。
エラーが出た際の設定や再現手順などがあれば教えて頂けますでしょうか?
私も試しましたがどうやらF1モードの起動でエラーが出ていたようでした。あちこちのAIに聞いて改良を試みましたが無理でしたので書き込みさせていただきました。ログは
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
google-colab 1.0.0 requires requests==2.32.4, but you have requests 2.31.0 which is incompatible.
google-adk 1.11.0 requires requests<3.0.0,>=2.32.4, but you have requests 2.31.0 which is incompatible.
thinc 8.3.6 requires numpy<3.0.0,>=2.0.0, but you have numpy 1.26.2 which is incompatible.
datasets 4.0.0 requires requests>=2.32.2, but you have requests 2.31.0 which is incompatible.
opencv-python-headless 4.12.0.88 requires numpy<2.3.0,>=2; python_version >= "3.9", but you have numpy 1.26.2 which is incompatible.
tsfresh 0.21.0 requires scipy>=1.14.0; python_version >= "3.10", but you have scipy 1.12.0 which is incompatible.
opencv-python 4.12.0.88 requires numpy<2.3.0,>=2; python_version >= "3.9", but you have numpy 1.26.2 which is incompatible.
Successfully installed accelerate-1.6.0 aiofiles-23.2.1 av-12.1.0 diffusers-0.33.1 gradio-5.23.0 gradio-client-1.8.0 numpy-1.26.2 opencv-contrib-python-4.11.0.86 pillow-11.1.0 requests-2.31.0 scipy-1.12.0 sentencepiece-0.2.0 tokenizers-0.20.3 torchsde-0.2.6 trampoline-0.1.2 transformers-4.46.2
WARNING: The following packages were previously imported in this runtime:
[PIL,numpy]
You must restart the runtime in order to use newly installed versions.
ERROR: Could not find a version that satisfies the requirement xformers==0.0.26.post2 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.16rc424, 0.0.16rc425, 0.0.16, 0.0.20, 0.0.21, 0.0.22, 0.0.22.post7, 0.0.23, 0.0.23.post1, 0.0.24, 0.0.25, 0.0.25.post1, 0.0.26.post1, 0.0.27, 0.0.27.post1, 0.0.27.post2, 0.0.28, 0.0.28.post1, 0.0.28.post2, 0.0.28.post3, 0.0.29, 0.0.29.post1, 0.0.29.post2, 0.0.29.post3, 0.0.30, 0.0.31, 0.0.31.post1, 0.0.32.post1, 0.0.32.post2, 0.0.33.dev1078, 0.0.33.dev1079)
ERROR: No matching distribution found for xformers==0.0.26.post2
F1モードで実行します。
/content/FramePack/webui/endframe_ichi_f1.py:3592: SyntaxWarning: invalid escape sequence '\d'
interim_pattern = re.compile(f'{job_id}combined_interim\d+.mp4')
endframe_ichi_f1.py : Starting....
HF_HOMEを設定: /content/FramePack/webui/hf_download
Traceback (most recent call last):
File "/content/FramePack/webui/endframe_ichi_f1.py", line 74, in
lora_state_cache.set_cache_enabled(saved_app_settings.get("lora_cache", False))
^^^^^^^^^^^^^^^^
NameError: name 'lora_state_cache' is not defined
@armpitranger ご返信が遅くなってしまい申し訳ありません。
共有ありがとうございます!調べてみますね。
解決までしばしお待ちいただけたらと思います。
@armpitranger お待たせしました。対応しましたので最新版にアップデートの上、ご利用頂けたらと思います。
ありがとうございます!少ないですがYouTubeスパチャさせていただきました。
@armpitranger ありがとうございます!大変励みになります!
いつもお世話になってますがエラーで使えなくなってしまいました。