PaddleNLP icon indicating copy to clipboard operation
PaddleNLP copied to clipboard

[Bug]: StableDiffusionPipelineAllinOne 的 inpaint 方法报错

Open ryanqx opened this issue 3 years ago • 1 comments

软件环境

paddle-bfloat                  0.1.7
paddle2onnx                    1.0.0
paddlefsl                      1.1.0
paddlehub                      2.3.0
paddlenlp                      2.4.2
paddlepaddle-gpu               2.3.2.post112
tb-paddle                      0.3.6

重复问题

  • [X] I have searched the existing issues

错误描述

使用 StableDiffusionPipelineAllinOne 的 inpaint 方法,Line 1203行报错:


~/.data/webide/pip/lib/python3.7/site-packages/ppdiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_all_in_one.py in inpaint(self, prompt, init_image, mask_image, height, width, strength, num_inference_steps, guidance_scale, negative_prompt, num_images_per_prompt, eta, seed, output_type, return_dict, callback, callback_steps, max_embeddings_multiples, no_boseos_middle, skip_parsing, skip_weighting, **kwargs)
   1201             init_image = preprocess_image(init_image)
   1202 
-> 1203         init_image.resize((width, height))
   1204         # encode the init image into latents and scale the latents
   1205         latents_dtype = text_embeddings.dtype

AttributeError: 'Tensor' object has no attribute 'resize'

稳定复现步骤 & 代码

        # preprocess image
        if not isinstance(init_image, paddle.Tensor):
            init_image = init_image.resize((width, height))
            init_image = preprocess_image(init_image)

        init_image.resize((width, height))
        # encode the init image into latents and scale the latents
        latents_dtype = text_embeddings.dtype

第二个init_image.resize((width, height))是错的,上面的代码已经把init_image转成paddle.Tensor了,这个resize应该删掉。

ryanqx avatar Nov 02 '22 10:11 ryanqx

好的,谢谢提醒~

JunnYu avatar Nov 02 '22 10:11 JunnYu

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] avatar Jan 02 '23 00:01 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。

github-actions[bot] avatar Jan 16 '23 00:01 github-actions[bot]