-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use comfyscript on modal return "ValueError: Host '127.0.0.1:8199' cannot contain ':'" #73
Comments
Does |
yes, the same error log
|
大佬你每次回复好像都好快 |
yarl 12 小时前的更新引入了破坏性更改(aio-libs/yarl#954 ),导致 aiohttp 在 URL 含端口时会出错(aio-libs/aiohttp#9307 ),可以先用 yarl 旧版( |
非常感谢~我周末试一下 |
aiohttp 3.10.7 似乎解决这个问题了,明天我试一下 |
验证了, |
现在可以正常运行推理了,但是最后返回的结果会报错。请问是我应该本地也要安装 PIL 或者 comfyui & comfyscript 吗?我现在本地什么都没安装。 class comfyui_flux_server:
@modal.build()
def build(self):
print('building container...')
@modal.enter()
def enter(self):
print('entering container...')
from comfy_script.runtime import load, ComfyUIArgs
load(args=ComfyUIArgs('--listen','127.0.0.1','--port','8199'))
@modal.exit()
def exit(self):
print('exiting container...')
@modal.method()
def inference(self, prompt, image_size, step, seed, guidance, sampler='euler', scheduler='simple', denoise=1):
print('start inference...')
from comfy_script.runtime import Workflow
from comfy_script.runtime.nodes import UnetLoaderGGUF, DualCLIPLoaderGGUF, VAELoader, EmptyLatentImage, CLIPTextEncode, CLIPTextEncodeFlux, ConditioningZeroOut, KSampler, VAEDecode, SaveImage, LoraLoaderModelOnly
with Workflow(queue=True, wait=True):
model = UnetLoaderGGUF(unet_name='flux.1_dev_city96_q8_0.gguf')
clip = DualCLIPLoaderGGUF(clip_name1='clip-vit-large-patch14_flux.1_comfyanonymous.safetensors', clip_name2='t5xxl_flux.1_city96_v1.1_q8_0.gguf', type='flux')
vae = VAELoader(vae_name='vae_flux.1_black-forest-labs.safetensors')
latent = EmptyLatentImage(width=image_size[0], height=image_size[1], batch_size=1)
conditioning_positive = CLIPTextEncodeFlux(clip_l=prompt, t5xxl=prompt, guidance=guidance, clip=clip)
conditioning_negative = CLIPTextEncode(text='', clip=clip)
latent = KSampler(model=model, seed=seed, steps=step, cfg=1, sampler_name=sampler, scheduler=scheduler, positive=conditioning_positive, negative=conditioning_negative, latent_image=latent, denoise=denoise)
image = VAEDecode(samples=latent, vae=vae)
result = SaveImage(image, 'comfyui')
print(type(image))
print(type(result))
return image 如果我让它
|
ComfyScript/examples/modal.py at main · Chaoses-Ib/ComfyScript |
from PIL import Image
images: list[Image.Image] = result.wait().wait() 这部分文档在 https://github.com/Chaoses-Ib/ComfyScript/blob/main/docs/Images/README.md#saving 。这个写法确实有点绕,后面可能会把惰性获取图片去掉来简化成 wait 一次,应该也没多少场景用得到。 Modal 支持不支持序列化 PIL.Image.Image 我不确定,如果不支持的话还要自己序列化下,可以用 |
谢谢说明!我明天试一下。我暂时用的笨方法,读取本地图片转成 bytes。我之前都是用的real模式,这个模式不了解,没注意到还要 wait。 for file_ in pathlib.Path('/root/comfy/ComfyUI/output').iterdir():
if file_.name.startswith(file_name_prefix):
return file_.read_bytes() |
i write my modal script according to your example script: ComfyScript/examples/modal.py at main · Chaoses-Ib/ComfyScript. modal always return error before or after comfyscript load(), may i ask for some help or advice?
my code snippets:
error in modal app logs:
The text was updated successfully, but these errors were encountered: