Skip to content

Fixed "NameError: name 'ftfy' is not defined" in Wan pipeline by directly importing ftfy. #12023

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 2 additions & 4 deletions src/diffusers/pipelines/wan/pipeline_wan.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import html
from typing import Any, Callable, Dict, List, Optional, Union

import ftfy
import regex as re
import torch
from transformers import AutoTokenizer, UMT5EncoderModel
Expand All @@ -23,7 +24,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 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 All @@ -39,9 +40,6 @@

logger = logging.get_logger(__name__) # pylint: disable=invalid-name

if is_ftfy_available():
import ftfy


EXAMPLE_DOC_STRING = """
Examples:
Expand Down