v1 app examples bug
dear大佬, 使用app.py 脚本,运行后出现bug,用的是第一个例子,4张图的。
[Debug] Generate image using aspect ratio [Instagram (1:1)] => 1024 x 1024
Start inference...
[Debug] Prompt: instagram photo, portrait photo of a woman img, colorful, perfect face, natural skin, hard shadows, film grain,
[Debug] Neg Prompt: (asymmetry, worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth
10
Traceback (most recent call last):
File "/data/envs/photomaker/lib/python3.10/site-packages/gradio/queueing.py", line 626, in process_events
response = await route_utils.call_process_api(
File "/data/envs/photomaker/lib/python3.10/site-packages/gradio/route_utils.py", line 322, in call_process_api
output = await app.get_blocks().process_api(
File "/data/envs/photomaker/lib/python3.10/site-packages/gradio/blocks.py", line 2220, in process_api
result = await self.call_function(
File "/data/envs/photomaker/lib/python3.10/site-packages/gradio/blocks.py", line 1731, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
File "/data/envs/photomaker/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/data//envs/photomaker/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread
return await future
File "/data//envs/photomaker/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 967, in run
result = context.run(func, *args)
File "/data//envs/photomaker/lib/python3.10/site-packages/gradio/utils.py", line 940, in wrapper
response = f(*args, **kwargs)
File "/data/soft/anaconda3/envs/photomaker/lib/python3.10/site-packages/gradio/utils.py", line 940, in wrapper
response = f(*args, **kwargs)
File "/data2//PhotoMaker/gradio_demo/app.py", line 88, in generate_image
images = pipe(
File "/data/envs/photomaker/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "/data/3/envs/photomaker/lib/python3.10/site-packages/photomaker/pipeline.py", line 708, in call
prompt_embeds = self.id_encoder(id_pixel_values, prompt_embeds, class_tokens_mask)
File "/data/s3/envs/photomaker/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/da3/envs/photomaker/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
File "/da/envs/photomaker/lib/python3.10/site-packages/photomaker/model.py", line 107, in forward
updated_prompt_embeds = self.fuse_module(prompt_embeds, id_embeds, class_tokens_mask)
File "/data/s/envs/photomaker/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/data/s3/envs/photomaker/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
File "/data/envs/photomaker/lib/python3.10/site-packages/photomaker/model.py", line 83, in forward
stacked_id_embeds = self.fuse_fn(image_token_embeds, valid_id_embeds)
File "/data/3/envs/photomaker/lib/python3.10/site-packages/photomaker/model.py", line 49, in fuse_fn
stacked_id_embeds = torch.cat([prompt_embeds, id_embeds], dim=-1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 8 but got size 4 for tensor number 1 in the list.
有没有大佬帮帮忙啊?
Package Version
accelerate 1.8.1 aiofiles 24.1.0 albucore 0.0.24 albumentations 2.0.8 annotated-types 0.7.0 antlr4-python3-runtime 4.9.3 anyio 4.9.0 certifi 2025.6.15 charset-normalizer 3.4.2 click 8.2.1 coloredlogs 15.0.1 contourpy 1.3.2 cycler 0.12.1 Cython 3.1.2 diffusers 0.29.1 easydict 1.13 einops 0.8.1 exceptiongroup 1.3.0 fastapi 0.115.14 ffmpy 0.6.0 filelock 3.13.1 flatbuffers 25.2.10 fonttools 4.58.4 fsspec 2024.6.1 gradio 5.35.0 gradio_client 1.10.4 groovy 0.1.2 h11 0.16.0 hf-xet 1.1.5 httpcore 1.0.9 httpx 0.28.1 huggingface-hub 0.33.2 humanfriendly 10.0 idna 3.10 imageio 2.37.0 importlib_metadata 8.7.0 insightface 0.7.3 Jinja2 3.1.4 joblib 1.5.1 kiwisolver 1.4.8 lazy_loader 0.4 markdown-it-py 3.0.0 MarkupSafe 2.1.5 matplotlib 3.10.3 mdurl 0.1.2 mpmath 1.3.0 networkx 3.3 numpy 2.1.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 9.1.0.70 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.21.5 nvidia-nvjitlink-cu12 12.1.105 nvidia-nvtx-cu12 12.1.105 omegaconf 2.3.0 onnx 1.18.0 onnxruntime-gpu 1.22.0 opencv-python-headless 4.11.0.86 orjson 3.10.18 packaging 25.0 pandas 2.3.0 peft 0.15.2 photomaker 0.2.0 pillow 11.0.0 pip 25.1 prettytable 3.16.0 protobuf 6.31.1 psutil 5.9.8 pydantic 2.11.7 pydantic_core 2.33.2 pydub 0.25.1 Pygments 2.19.2 pyparsing 3.2.3 python-dateutil 2.9.0.post0 python-multipart 0.0.20 pytz 2025.2 PyYAML 6.0.2 regex 2024.11.6 requests 2.32.4 rich 14.0.0 ruff 0.12.1 safehttpx 0.1.6 safetensors 0.5.3 scikit-image 0.25.2 scikit-learn 1.7.0 scipy 1.15.3 semantic-version 2.10.0 setuptools 78.1.1 shellingham 1.5.4 simsimd 6.4.9 six 1.17.0 sniffio 1.3.1 spaces 0.37.1 starlette 0.46.2 stringzilla 3.12.5 sympy 1.13.1 threadpoolctl 3.6.0 tifffile 2025.5.10 tokenizers 0.21.2 tomlkit 0.13.3 torch 2.5.1+cu121 torchaudio 2.5.1+cu121 torchvision 0.20.1+cu121 tqdm 4.67.1 transformers 4.53.0 triton 3.1.0 typer 0.16.0 typing_extensions 4.12.2 typing-inspection 0.4.1 tzdata 2025.2 urllib3 2.5.0 uvicorn 0.35.0 wcwidth 0.2.13 websockets 15.0.1 wheel 0.45.1 zipp 3.23.0
有没有大佬帮帮忙,感谢,thx