-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Fix Flux Controlnet Pipeline _callback_tensor_inputs Missing Some Elements #10974
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
Fix Flux Controlnet Pipeline _callback_tensor_inputs Missing Some Elements #10974
Conversation
|
I've also accidentally noticed that Flux related pipeline classes are missing some base classes. class FluxPipeline(
DiffusionPipeline,
FluxLoraLoaderMixin,
FromSingleFileMixin,
TextualInversionLoaderMixin,
FluxIPAdapterMixin,
):...
class FluxImg2ImgPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FromSingleFileMixin, FluxIPAdapterMixin):...
class FluxInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FluxIPAdapterMixin):...I'll fix it in another PR. |
|
oh that's nice, never tried changing the mask of the inpainting on a callback, could lead to some interesting results. Did you tried doing that? Checking the XL one, they do have the mask inputs but nevertheless, I've never tried doing something with it. Also, the other inpaint pipelines have the |
Yes, it makes it possible to make a CFG cutoff callback function for inpainting pipeline. def f(pipeline, i, t, callback_kwargs):
cutoff_step = int(pipeline.num_timesteps * 0.5)
if i == cutoff_step:
prompt_embeds = callback_kwargs["prompt_embeds"]
prompt_embeds = prompt_embeds[-1:]
add_text_embeds = callback_kwargs["add_text_embeds"]
add_text_embeds = add_text_embeds[-1:]
add_time_ids = callback_kwargs["add_time_ids"]
add_time_ids = add_time_ids[-1:]
mask = callback_kwargs["mask"]
mask = mask[-1:]
pipeline._guidance_scale = 0.0
callback_kwargs["prompt_embeds"] = prompt_embeds
callback_kwargs["add_text_embeds"] = add_text_embeds
callback_kwargs["add_time_ids"] = add_time_ids
callback_kwargs["mask"] = mask
return callback_kwargs
Because it does nothing in Flux inpainting denoising loop, which means any change to |
|
yeah, lets keep it uniform with the rest of the API, even if it's not used right now. |
👌 |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
thanks! Failing test are not related to this PR. |
._callback_tensor_inputsof Flux controlnet related pipelines are missing some important elements.This PR is to fix it.
I'll be very appreciated if you can have a check.
@asomoza