Skip to content

Using a Mask with the img2img Pipeline (perhaps as callback function?) #2073

@nicollegah

Description

@nicollegah

I am having a looped img2img pipeline to produce videos - similar to deforum. For that, I would love some objects in the scene to remain unchanged. The way to do this, is to use a mask. With huggingface components, the only way I am aware of achieving this is the inpainting models - however that is a different thing. I want a certain part of the images to remain unchanged, but the normal img2img pipeline acting on the rest.

There is the callback function in the img2img pipeline and my guess is, that one could use that to achieve what I am asking for, but I am unsure how.

The deforum script somehow does it (I think here: https://github.com/HelixNGC7293/DeforumStableDiffusionLocal/blob/17bf2f9b07167f8958065fa1b322ff83029d95b2/deforum-stable-diffusion/helpers/generate.py#L268 although there are several similar lines in the repo).

Thanks for your amazing work.

Metadata

Metadata

Labels

staleIssues that haven't received updates

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions