Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -153,7 +153,7 @@ def reset_inference_state():
|
|
| 153 |
|
| 154 |
# Move necessary models back to the correct device
|
| 155 |
if low_vram:
|
| 156 |
-
models_to(models_rbm, device=
|
| 157 |
models_rbm.generator.to(device)
|
| 158 |
models_rbm.previewer.to(device)
|
| 159 |
else:
|
|
@@ -174,10 +174,9 @@ def reset_inference_state():
|
|
| 174 |
torch.cuda.empty_cache()
|
| 175 |
gc.collect()
|
| 176 |
|
| 177 |
-
def infer(
|
| 178 |
global models_rbm, models_b
|
| 179 |
try:
|
| 180 |
-
caption = f"{caption} in {style_description}"
|
| 181 |
height=1024
|
| 182 |
width=1024
|
| 183 |
batch_size=1
|
|
|
|
| 153 |
|
| 154 |
# Move necessary models back to the correct device
|
| 155 |
if low_vram:
|
| 156 |
+
models_to(models_rbm, device="cpu", excepts=["generator", "previewer"])
|
| 157 |
models_rbm.generator.to(device)
|
| 158 |
models_rbm.previewer.to(device)
|
| 159 |
else:
|
|
|
|
| 174 |
torch.cuda.empty_cache()
|
| 175 |
gc.collect()
|
| 176 |
|
| 177 |
+
def infer(style_description, ref_style_file, caption):
|
| 178 |
global models_rbm, models_b
|
| 179 |
try:
|
|
|
|
| 180 |
height=1024
|
| 181 |
width=1024
|
| 182 |
batch_size=1
|