Skip to content
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

hidiffusion.py fixes #3

Open
JohnnyStreet opened this issue Apr 23, 2024 · 3 comments
Open

hidiffusion.py fixes #3

JohnnyStreet opened this issue Apr 23, 2024 · 3 comments

Comments

@JohnnyStreet
Copy link

You define the name_or_path where model.name_or_path is not known but then you reference model.name_or_path anyway which breaks it for non-default models.

Line 1831:

'is_inpainting_task': 'inpainting' in model.name_or_path, 'is_playground': 'playground' in model.name_or_path}

Should be:

'is_inpainting_task': 'inpainting' in name_or_path, 'is_playground': 'playground' in name_or_path}

You also have a typo in a variable name which should be supported_official_model

It is working with this fix although I did notice you do not get the same image when you use the same seed twice. Not sure if this is expected behavior or not.

@ShenZhang-Shin
Copy link
Collaborator

Thanks a lot. "name_or_path" is the backbone model being used, and "model.name_or_path" refers to the name being passed in. 'inpainting' in name_or_path is right, but 'is_playground': 'playground' in name_or_path is not equivalent to 'playground' in model.name_or_path. It is a bit convoluted. I will streamline it. typo will also be fixed.

@JohnnyStreet
Copy link
Author

"name_or_path" is the backbone model being used, and "model.name_or_path" refers to the name being passed in.

There was no model.name_or_path on my model so it was referencing a NoneType. I made that change and it seems to work. I can confirm it is doing something by using the same seed as without. The results on widescreen images are much more coherent, without the usual repeating or stretching associated with it trying to tile.

@vladmandic
Copy link

vladmandic commented Apr 24, 2024

@ShenZhang-Shin first, diffusers dont have name_or_path param, so that will always be invalid.
also, using model name to determine if its inpainting task is flawed to start with.

@JohnnyStreet your proposed solution will always result in false, so inpainting mode will not be detected

you can use this:

  from diffusers.pipelines import auto_pipeline
  is_inpainting_task = model.__class__ in auto_pipeline.AUTO_INPAINT_PIPELINES_MAPPING.values()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants