mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Remove regional conditioning logic from MultiDiffusionPipeline - it is not yet supported.
This commit is contained in:
parent
49ca42f84a
commit
865c2335de
@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
from contextlib import nullcontext
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
import torch
|
||||
@ -12,7 +11,6 @@ from invokeai.backend.stable_diffusion.diffusers_pipeline import (
|
||||
StableDiffusionGeneratorPipeline,
|
||||
)
|
||||
from invokeai.backend.stable_diffusion.diffusion.conditioning_data import TextConditioningData
|
||||
from invokeai.backend.stable_diffusion.diffusion.unet_attention_patcher import UNetAttentionPatcher
|
||||
from invokeai.backend.tiles.utils import Tile
|
||||
|
||||
|
||||
@ -79,12 +77,8 @@ class MultiDiffusionPipeline(StableDiffusionGeneratorPipeline):
|
||||
use_regional_prompting = (
|
||||
conditioning_data.cond_regions is not None or conditioning_data.uncond_regions is not None
|
||||
)
|
||||
unet_attention_patcher = None
|
||||
attn_ctx = nullcontext()
|
||||
|
||||
if use_regional_prompting:
|
||||
unet_attention_patcher = UNetAttentionPatcher(ip_adapter_data=None)
|
||||
attn_ctx = unet_attention_patcher.apply_ip_adapter_attention(self.invokeai_diffuser.model)
|
||||
raise NotImplementedError("Regional prompting is not yet supported in Multi-Diffusion.")
|
||||
|
||||
# Populate a weighted mask that will be used to combine the results from each region after every step.
|
||||
# For now, we assume that each regions has the same weight (1.0).
|
||||
@ -96,7 +90,6 @@ class MultiDiffusionPipeline(StableDiffusionGeneratorPipeline):
|
||||
:, :, region.coords.top : region.coords.bottom, region.coords.left : region.coords.right
|
||||
] += 1.0
|
||||
|
||||
with attn_ctx:
|
||||
callback(
|
||||
PipelineIntermediateState(
|
||||
step=-1,
|
||||
|
Loading…
Reference in New Issue
Block a user