Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/diffusers/pipelines/chronoedit/pipeline_chronoedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from ...loaders import WanLoraLoaderMixin
from ...models import AutoencoderKLWan, ChronoEditTransformer3DModel
from ...schedulers import FlowMatchEulerDiscreteScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -95,7 +95,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
3 changes: 3 additions & 0 deletions src/diffusers/pipelines/kandinsky5/pipeline_kandinsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

# Add imports for offloading and tiling
from ...utils import (
BACKENDS_MAPPING,
is_ftfy_available,
is_torch_xla_available,
logging,
Expand Down Expand Up @@ -103,6 +104,8 @@ def basic_clean(text):
"""
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
3 changes: 3 additions & 0 deletions src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

# Add imports for offloading and tiling
from ...utils import (
BACKENDS_MAPPING,
is_ftfy_available,
is_torch_xla_available,
logging,
Expand Down Expand Up @@ -92,6 +93,8 @@ def basic_clean(text):
"""
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
3 changes: 3 additions & 0 deletions src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2v.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

# Add imports for offloading and tiling
from ...utils import (
BACKENDS_MAPPING,
is_ftfy_available,
is_torch_xla_available,
logging,
Expand Down Expand Up @@ -100,6 +101,8 @@ def basic_clean(text):
"""
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
3 changes: 3 additions & 0 deletions src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

# Add imports for offloading and tiling
from ...utils import (
BACKENDS_MAPPING,
is_ftfy_available,
is_torch_xla_available,
logging,
Expand Down Expand Up @@ -92,6 +93,8 @@ def basic_clean(text):
"""
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
7 changes: 5 additions & 2 deletions src/diffusers/pipelines/lucy/pipeline_lucy_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from ...loaders import WanLoraLoaderMixin
from ...models import AutoencoderKLWan, WanTransformer3DModel
from ...schedulers import FlowMatchEulerDiscreteScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -101,7 +101,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
7 changes: 5 additions & 2 deletions src/diffusers/pipelines/prx/pipeline_prx.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
from diffusers.pipelines.prx.pipeline_output import PRXPipelineOutput
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
from diffusers.utils import is_ftfy_available, logging, replace_example_docstring
from diffusers.utils import BACKENDS_MAPPING, is_ftfy_available, logging, replace_example_docstring
from diffusers.utils.torch_utils import randn_tensor


Expand Down Expand Up @@ -197,7 +197,10 @@ def clean_text(self, text: str) -> str:
text = re.sub(regex2, " ", text)

# Basic cleaning
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
text = text.strip()

Expand Down
7 changes: 5 additions & 2 deletions src/diffusers/pipelines/skyreels_v2/pipeline_skyreels_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ...loaders import SkyReelsV2LoraLoaderMixin
from ...models import AutoencoderKLWan, SkyReelsV2Transformer3DModel
from ...schedulers import UniPCMultistepScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -88,7 +88,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from ...loaders import SkyReelsV2LoraLoaderMixin
from ...models import AutoencoderKLWan, SkyReelsV2Transformer3DModel
from ...schedulers import UniPCMultistepScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -95,7 +95,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from ...loaders import SkyReelsV2LoraLoaderMixin
from ...models import AutoencoderKLWan, SkyReelsV2Transformer3DModel
from ...schedulers import UniPCMultistepScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ..pipeline_utils import DiffusionPipeline
from .pipeline_output import SkyReelsV2PipelineOutput

Expand Down Expand Up @@ -100,7 +100,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ...loaders import SkyReelsV2LoraLoaderMixin
from ...models import AutoencoderKLWan, SkyReelsV2Transformer3DModel
from ...schedulers import UniPCMultistepScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -96,7 +96,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from ...loaders import SkyReelsV2LoraLoaderMixin
from ...models import AutoencoderKLWan, SkyReelsV2Transformer3DModel
from ...schedulers import UniPCMultistepScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -94,7 +94,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
4 changes: 3 additions & 1 deletion src/diffusers/pipelines/wan/pipeline_wan.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ...loaders import WanLoraLoaderMixin
from ...models import AutoencoderKLWan, WanTransformer3DModel
from ...schedulers import FlowMatchEulerDiscreteScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -78,6 +78,8 @@
def basic_clean(text):
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
7 changes: 5 additions & 2 deletions src/diffusers/pipelines/wan/pipeline_wan_animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ...loaders import WanLoraLoaderMixin
from ...models import AutoencoderKLWan, WanAnimateTransformer3DModel
from ...schedulers import UniPCMultistepScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -117,7 +117,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
7 changes: 5 additions & 2 deletions src/diffusers/pipelines/wan/pipeline_wan_i2v.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from ...loaders import WanLoraLoaderMixin
from ...models import AutoencoderKLWan, WanTransformer3DModel
from ...schedulers import FlowMatchEulerDiscreteScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -94,7 +94,10 @@


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
7 changes: 5 additions & 2 deletions src/diffusers/pipelines/wan/pipeline_wan_vace.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from ...loaders import WanLoraLoaderMixin
from ...models import AutoencoderKLWan, WanVACETransformer3DModel
from ...schedulers import FlowMatchEulerDiscreteScheduler
from ...utils import is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils import BACKENDS_MAPPING, is_ftfy_available, is_torch_xla_available, logging, replace_example_docstring
from ...utils.torch_utils import randn_tensor
from ...video_processor import VideoProcessor
from ..pipeline_utils import DiffusionPipeline
Expand Down Expand Up @@ -108,7 +108,10 @@ def prepare_video_and_mask(first_img: PIL.Image.Image, last_img: PIL.Image.Image


def basic_clean(text):
text = ftfy.fix_text(text)
if is_ftfy_available():
text = ftfy.fix_text(text)
else:
logger.warning(BACKENDS_MAPPING["ftfy"][-1].format("Cleaning prompts"))
text = html.unescape(html.unescape(text))
return text.strip()

Expand Down
Loading