Skip to content

SiglipImageProcessor has no .to() method (SD3IPAdapterMixin issue) #11024

Closed
@Johnny-Katsa

Description

@Johnny-Katsa

Describe the bug

The SD3IPAdapterMixin incorrectly applies .to(self.device, dtype=self.dtype) to SiglipImageProcessor, which does not have a .to() method.

feature_extractor=SiglipImageProcessor.from_pretrained(image_encoder_subfolder, **kwargs).to(
self.device, dtype=self.dtype
),

This causes an AttributeError when loading an IP-Adapter with an image encoder.

Reproduction

import torch
from diffusers import StableDiffusion3Pipeline

pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16)
pipe.load_ip_adapter("InstantX/SD3.5-Large-IP-Adapter", "ip-adapter.bin", image_encoder_folder="google/siglip-base-patch16-224")

Logs

AttributeError: 'SiglipImageProcessor' object has no attribute 'to'

System Info

  • 🤗 Diffusers version: 0.32.2
  • Platform: Windows-10-10.0.26100-SP0
  • Running on Google Colab?: No
  • Python version: 3.10.11
  • PyTorch version (GPU?): 2.6.0+cpu (False)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Huggingface_hub version: 0.29.1
  • Transformers version: 4.49.0
  • Accelerate version: 1.4.0
  • PEFT version: not installed
  • Bitsandbytes version: not installed
  • Safetensors version: 0.5.3
  • xFormers version: not installed
  • Accelerator: NA
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions