Skip to content

Commit

Permalink
Improves LoRA
Browse files Browse the repository at this point in the history
  • Loading branch information
w4ffl35 committed Oct 4, 2024
1 parent 4cbb9aa commit 0fd9dd5
Show file tree
Hide file tree
Showing 22 changed files with 1,007 additions and 435 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"tensorflow==2.17.0",
"DeepCache==0.1.1",
"tensorflow==2.17.0",
"alembic==1.13.3",

# LLM Dependencies
"transformers==4.43.4",
Expand Down
12 changes: 11 additions & 1 deletion src/airunner/aihandler/base_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@ def __init__(self, *args, **kwargs):
MediatorMixin.__init__(self)
SettingsMixin.__init__(self)
super().__init__(*args, **kwargs)
self._requested_action = None
self._requested_action:ModelAction = ModelAction.NONE

@property
def requested_action(self):
return self._requested_action

@requested_action.setter
def requested_action(self, value):
self._requested_action = value

def handle_requested_action(self):
if self._requested_action is ModelAction.LOAD:
self.load()
self._requested_action = ModelAction.NONE
if self._requested_action is ModelAction.CLEAR:
self.unload()
self._requested_action = ModelAction.NONE

def load(self):
pass
Expand Down
4 changes: 3 additions & 1 deletion src/airunner/aihandler/models/settings_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ class GeneratorSettings(Base):
negative_original_size = Column(JSON, default={"width": 512, "height": 512})
negative_target_size = Column(JSON, default={"width": 512, "height": 512})

lora_scale = Column(Integer, default=100)


class ControlnetImageSettings(Base):
__tablename__ = 'controlnet_image_settings'
Expand Down Expand Up @@ -468,7 +470,7 @@ class Lora(Base):
__tablename__ = 'lora'
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String, nullable=False)
scale = Column(Float, nullable=False)
scale = Column(Integer, nullable=False)
enabled = Column(Boolean, nullable=False)
loaded = Column(Boolean, default=False, nullable=False)
trigger_word = Column(String, nullable=True)
Expand Down
Loading

0 comments on commit 0fd9dd5

Please sign in to comment.