Skip to content

Commit

Permalink
(fix) update freeU config to be compatible with custom nodes (invoke-…
Browse files Browse the repository at this point in the history
…ai#5050)

## What type of PR is this? (check all applicable)

- [ ] Refactor
- [ ] Feature
- [X] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Community Node Submission


## Have you discussed this change with the InvokeAI team?
- [X] Yes: @psychedelicious told me to do this :) 
- [ ] No, because:

      
## Have you updated all relevant documentation?
- [ ] Yes
- [ ] No


## Description


## Related Tickets & Documents

<!--
For pull requests that relate or close an issue, please include them
below. 

For example having the text: "closes invoke-ai#1234" would connect the current
pull
request to issue 1234.  And when we merge the pull request, Github will
automatically close the issue.
-->

- Related Issue #
- Closes #

## QA Instructions, Screenshots, Recordings

<!-- 
Please provide steps on how to test changes, any hardware or 
software specifications as well as any other pertinent information. 
-->

## Added/updated tests?

- [ ] Yes
- [ ] No : _please replace this line with details on why tests
      have not been included_

## [optional] Are there any post deployment tasks we need to perform?
  • Loading branch information
hipsterusername authored Nov 7, 2023
2 parents 9733cd4 + 4cfd559 commit a760bda
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions invokeai/app/invocations/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

from pydantic import BaseModel, ConfigDict, Field

from invokeai.app.invocations.shared import FreeUConfig

from ...backend.model_management import BaseModelType, ModelType, SubModelType
from .baseinvocation import (
BaseInvocation,
Expand All @@ -19,6 +17,22 @@
invocation_output,
)

# TODO: Permanent fix for this
# from invokeai.app.invocations.shared import FreeUConfig


class FreeUConfig(BaseModel):
"""
Configuration for the FreeU hyperparameters.
- https://huggingface.co/docs/diffusers/main/en/using-diffusers/freeu
- https://github.com/ChenyangSi/FreeU
"""

s1: float = Field(ge=-1, le=3, description=FieldDescriptions.freeu_s1)
s2: float = Field(ge=-1, le=3, description=FieldDescriptions.freeu_s2)
b1: float = Field(ge=-1, le=3, description=FieldDescriptions.freeu_b1)
b2: float = Field(ge=-1, le=3, description=FieldDescriptions.freeu_b2)


class ModelInfo(BaseModel):
model_name: str = Field(description="Info to load submodel")
Expand Down

0 comments on commit a760bda

Please sign in to comment.