Skip to content

Kolors fails to import on PyTorch nightly: torch.jit.script was removed #15315

Closed

Description

@klin2024

Describe the bug

PyTorch removed the deprecated public TorchScript APIs (torch.jit.script, trace, load, ...) in pytorch/pytorch#203621 (on main since 2026-11-09). src/diffusers/pipelines/kolors/text_encoder.py decorates apply_rotary_pos_emb with @torch.jit.script at module level, so importing the Kolors pipelines fails on nightlies built after that. It is the only use of a removed torch.jit API under src/.

Reproduction

from diffusers import KolorsPipeline

Logs

RuntimeError: Failed to import diffusers.pipelines.kolors.pipeline_kolors because of the following error (look up to see its traceback):
module 'torch.jit' has no attribute 'script'

System Info

diffusers main (865e421), torch 2.16.0a0 nightly (2026-11-14), transformers 5.21.0, Python 3.12, Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions