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
10 changes: 5 additions & 5 deletions src/diffusers/modular_pipelines/ernie_image/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import json

import torch
from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer
from transformers import AutoTokenizer, Ministral3ForCausalLM, Mistral3Model

from ...configuration_utils import FrozenDict
from ...guiders import ClassifierFreeGuidance
Expand All @@ -38,7 +38,7 @@ def description(self) -> str:
@property
def expected_components(self) -> list[ComponentSpec]:
return [
ComponentSpec("pe", AutoModelForCausalLM),
ComponentSpec("pe", Ministral3ForCausalLM),
ComponentSpec("pe_tokenizer", AutoTokenizer),
]

Expand Down Expand Up @@ -83,7 +83,7 @@ def intermediate_outputs(self) -> list[OutputParam]:

@staticmethod
def _enhance_prompt(
pe: AutoModelForCausalLM,
pe: Ministral3ForCausalLM,
pe_tokenizer: AutoTokenizer,
prompt: str,
device: torch.device,
Expand Down Expand Up @@ -160,7 +160,7 @@ def description(self) -> str:
@property
def expected_components(self) -> list[ComponentSpec]:
return [
ComponentSpec("text_encoder", AutoModel),
ComponentSpec("text_encoder", Mistral3Model),
ComponentSpec("tokenizer", AutoTokenizer),
ComponentSpec(
"guider",
Expand Down Expand Up @@ -200,7 +200,7 @@ def intermediate_outputs(self) -> list[OutputParam]:

@staticmethod
def _encode(
text_encoder: AutoModel,
text_encoder: Mistral3Model,
tokenizer: AutoTokenizer,
prompt: list[str],
device: torch.device,
Expand Down
6 changes: 3 additions & 3 deletions src/diffusers/pipelines/ernie_image/pipeline_ernie_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from typing import Callable, List, Optional, Union

import torch
from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer
from transformers import AutoTokenizer, Ministral3ForCausalLM, Mistral3Model

from ...image_processor import VaeImageProcessor
from ...loaders import ErnieImageLoraLoaderMixin
Expand Down Expand Up @@ -52,10 +52,10 @@ def __init__(
self,
transformer: ErnieImageTransformer2DModel,
vae: AutoencoderKLFlux2,
text_encoder: AutoModel,
text_encoder: Mistral3Model,
tokenizer: AutoTokenizer,
scheduler: FlowMatchEulerDiscreteScheduler,
pe: Optional[AutoModelForCausalLM] = None,
pe: Optional[Ministral3ForCausalLM] = None,
pe_tokenizer: Optional[AutoTokenizer] = None,
):
super().__init__()
Expand Down
Loading