Skip to content

[debug] FluxControlImg2ImgPipeline 和 FluxControlImg2ImgPipeline 运行报错: #1272

@whisky-12

Description

@whisky-12
import paddle

from ppdiffusers import FluxPipeline
from ppdiffusers import ControlNetModel,,FluxControlPipeline,FluxControlImg2ImgPipeline,AutoencoderKL
from ppdiffusers.utils import load_image


pipe = FluxControlPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",paddle_dtype=paddle.float16, low_cpu_mem_usage=True, map_location="cpu",
)


image = load_image(
    "robot.png"
)
control_image=load_image(
    "多啦A梦.jpeg"
)

# 运行推理
prompt = "a photo of a cat robot"
output = pipe(
    prompt=prompt,
    control_image=control_image,
    num_inference_steps=50,
)


# 或者 

pipe = FluxControlImg2ImgPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",paddle_dtype=paddle.float16, low_cpu_mem_usage=True, map_location="cpu",
)


# 运行推理
prompt = "a photo of a cat robot"
output = pipe(
    prompt=prompt,
    control_image=control_image,
    image=image,
    num_inference_steps=50,
)

报错:

ValueError: (InvalidArgument) The 'shape' in ReshapeOp is invalid. The input tensor X'size must be equal to the capacity of 'shape'. But received X's shape = [1, 16, 128, 128], X's size = 262144, 'shape' is [1, 8, 64, 2, 64, 2], the capacity of 'shape' is 131072.
[Hint: Expected capacity == in_size, but received capacity:131072 != in_size:262144.] (at ../paddle/phi/infermeta/unary.cc:2246)

Image

同时:

# 加载vue模型
vae = AutoencoderKL.from_single_file("models/flux-vae.safetensors")



# controlnet模型我们选用lineart类别的来提取线条
controlnet = ControlNetModel.from_pretrained("lllyasviel/control_v11p_sd15_lineart", paddle_dtype=paddle.float16)

上述加载flux-vae会报错,希望官方可以给出支持接在flux vae 模型地址,并且controlnet不能适配FluxControl管道,也需要给出优化解决方案

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions