Skip to content
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

Fix T5EncoderField initialization in SD3 model loader #7604

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

RyanJDick
Copy link
Collaborator

@RyanJDick RyanJDick commented Jan 28, 2025

Summary

Fixes a minor bug that was introduced in #7590.

Prior to this fix, loading an SD3.5 model would produce this error:

[2025-01-28 22:41:48,643]::[InvokeAI]::ERROR --> Error while invoking session 1f03b5d1-f099-4a79-816c-1bae1aafa4c9, invocation 40c782ff-b38b-4137-9deb-a04874cb56be (sd3_model_loader): 1 validation error for T5EncoderField
loras
  Field required [type=missing, input_value={'tokenizer': ModelIdenti...er3: 'text_encoder_3'>)}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing
[2025-01-28 22:41:48,643]::[InvokeAI]::ERROR --> Traceback (most recent call last):
  File "/home/ryan/src/InvokeAI/invokeai/app/services/session_processor/session_processor_default.py", line 129, in run_node
    output = invocation.invoke_internal(context=context, services=self._services)
  File "/home/ryan/src/InvokeAI/invokeai/app/invocations/baseinvocation.py", line 300, in invoke_internal
    output = self.invoke(context)
  File "/home/ryan/src/InvokeAI/invokeai/app/invocations/sd3_model_loader.py", line 102, in invoke
    t5_encoder=T5EncoderField(tokenizer=tokenizer_t5, text_encoder=t5_encoder),
  File "/home/ryan/.pyenv/versions/3.10.14/envs/InvokeAI_3.10.14/lib/python3.10/site-packages/pydantic/main.py", line 176, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for T5EncoderField
loras
  Field required [type=missing, input_value={'tokenizer': ModelIdenti...er3: 'text_encoder_3'>)}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing

Related Issues / Discussions

Introduced in #7590

QA Instructions

Tested that an SD3.5 model runs successfully.

Merge Plan

Merge once approved.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations labels Jan 28, 2025
@hipsterusername hipsterusername merged commit 285313b into main Jan 29, 2025
15 checks passed
@hipsterusername hipsterusername deleted the ryan/fix-sd3-model-loader branch January 29, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invocations PRs that change invocations python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants