代码拉取完成,页面将自动刷新
# import sys
# import locale
# import subprocess
# import threading
# # copied from https://github.com/ltdrdata/ComfyUI-Impact-Pack/blob/Main/install.py#L37
# def handle_stream(stream, is_stdout):
# stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
# for msg in stream:
# if is_stdout:
# print(msg, end="", file=sys.stdout)
# else:
# print(msg, end="", file=sys.stderr)
# # copied from https://github.com/ltdrdata/ComfyUI-Impact-Pack/blob/Main/install.py#L37
# def process_wrap(cmd_str, cwd=None, handler=None):
# print(f"[Impact Pack] EXECUTE: {cmd_str} in '{cwd}'")
# process = subprocess.Popen(cmd_str, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1)
# if handler is None:
# handler = handle_stream
# stdout_thread = threading.Thread(target=handler, args=(process.stdout, True))
# stderr_thread = threading.Thread(target=handler, args=(process.stderr, False))
# stdout_thread.start()
# stderr_thread.start()
# stdout_thread.join()
# stderr_thread.join()
# return process.wait()
# pip_install = [sys.executable, "-s", "-m", "pip", "install"]
# process_wrap(pip_install + ['-r', 'requirements.txt'], cwd=__file__)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。