diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Want to use "strict=False" in from_pretrained

Open CuddleSabe opened this issue 1 year ago • 5 comments

What API design would you like to have changed or added to the library? Why? I want to add param "strict" in from_pretrained. I want to add zerosft controlnet, but it can only implement by adding the set layers to unet class, when I use from_pretrained, it can't use "strict=False"

What use case would this enable or better enable? Can you give us a code example?

def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], strict: bool=True, **kwargs):

CuddleSabe avatar Apr 08 '24 10:04 CuddleSabe

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar May 08 '24 15:05 github-actions[bot]

Hi @CuddleSabe can you provide a link to the zerosft controlnet you want to use? the short answer is that we would not want to add "strict=False" to from_pretrained but we can look into supporting this new controlnet model from diffusers

cc @asomoza here, have you checked out this model? do we want to support it?

yiyixuxu avatar May 08 '24 19:05 yiyixuxu

For what I understand it's not a controlnet but a connector used for the controlnet used in SUPIR:

It designs an effective 620 million parameter adaptor to steer the generative prior for image restoration. The paper introduces techniques like a robust encoder, trimmed architecture, and a new ZeroSFT connector to make model scaling feasible.

I think @CuddleSabe is trying to port SUPIR to diffusers but I don't know if as a contribution or as a closed source private solution.

asomoza avatar May 08 '24 20:05 asomoza

For what I understand it's not a controlnet but a connector used for the controlnet used in SUPIR:

It designs an effective 620 million parameter adaptor to steer the generative prior for image restoration. The paper introduces techniques like a robust encoder, trimmed architecture, and a new ZeroSFT connector to make model scaling feasible.

I think @CuddleSabe is trying to port SUPIR to diffusers but I don't know if as a contribution or as a closed source private solution.

Hi, I solve it by create new class inherited from "CrossAttnUpBlock2D" 、“UpBlock2D” and "UNetMidBlock2DCrossAttn" but my edition is used to implement sdv1.5 SUPIR (the official is SDXL)

CuddleSabe avatar May 09 '24 03:05 CuddleSabe

For what I understand it's not a controlnet but a connector used for the controlnet used in SUPIR:

It designs an effective 620 million parameter adaptor to steer the generative prior for image restoration. The paper introduces techniques like a robust encoder, trimmed architecture, and a new ZeroSFT connector to make model scaling feasible.

I think @CuddleSabe is trying to port SUPIR to diffusers but I don't know if as a contribution or as a closed source private solution.

The SUPIR ControlNet can directly load into diffusers' Controlnet class, their outputs have same shapes. To support SUPIR, maybe we have to create new classes inherited from diffusers, new classes have "zerosft".

CuddleSabe avatar May 09 '24 03:05 CuddleSabe

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Sep 14 '24 15:09 github-actions[bot]