Spaces:
Running
on
Zero
Running
on
Zero
手动补充scaling
Browse files- .gitignore +4 -0
- OminiControl/src/flux/lora_controller.py +7 -0
- ominicontrol.py +2 -2
.gitignore
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.vscode
|
| 2 |
+
.DS_Store
|
| 3 |
+
__pycache__
|
| 4 |
+
checkpoints
|
OminiControl/src/flux/lora_controller.py
CHANGED
|
@@ -7,6 +7,13 @@ class enable_lora:
|
|
| 7 |
self.activated: bool = activated
|
| 8 |
if activated:
|
| 9 |
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
self.lora_modules: List[BaseTunerLayer] = [
|
| 11 |
each for each in lora_modules if isinstance(each, BaseTunerLayer)
|
| 12 |
]
|
|
|
|
| 7 |
self.activated: bool = activated
|
| 8 |
if activated:
|
| 9 |
return
|
| 10 |
+
|
| 11 |
+
for lora_module in lora_modules:
|
| 12 |
+
for active_adapter in lora_module.active_adapters:
|
| 13 |
+
scaling = lora_module.scaling
|
| 14 |
+
if active_adapter not in scaling:
|
| 15 |
+
scaling[active_adapter] = 1.0
|
| 16 |
+
|
| 17 |
self.lora_modules: List[BaseTunerLayer] = [
|
| 18 |
each for each in lora_modules if isinstance(each, BaseTunerLayer)
|
| 19 |
]
|
ominicontrol.py
CHANGED
|
@@ -3,7 +3,6 @@ from diffusers.pipelines import FluxPipeline
|
|
| 3 |
from OminiControl.src.flux.condition import Condition
|
| 4 |
from PIL import Image
|
| 5 |
import random
|
| 6 |
-
import math
|
| 7 |
|
| 8 |
from OminiControl.src.flux.generate import generate, seed_everything
|
| 9 |
|
|
@@ -43,7 +42,8 @@ pipe.load_lora_weights(
|
|
| 43 |
)
|
| 44 |
# ref: https://civitai.com/models/824739/flux-3d-animation-style-lora
|
| 45 |
pipe.load_lora_weights(
|
| 46 |
-
"./lora
|
|
|
|
| 47 |
adapter_name="3d_animation",
|
| 48 |
)
|
| 49 |
|
|
|
|
| 3 |
from OminiControl.src.flux.condition import Condition
|
| 4 |
from PIL import Image
|
| 5 |
import random
|
|
|
|
| 6 |
|
| 7 |
from OminiControl.src.flux.generate import generate, seed_everything
|
| 8 |
|
|
|
|
| 42 |
)
|
| 43 |
# ref: https://civitai.com/models/824739/flux-3d-animation-style-lora
|
| 44 |
pipe.load_lora_weights(
|
| 45 |
+
"./lora",
|
| 46 |
+
weight_name="3d_animation.safetensors",
|
| 47 |
adapter_name="3d_animation",
|
| 48 |
)
|
| 49 |
|