Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,8 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
52 |
kontext_model,
|
53 |
quantization_config=quant_config,
|
54 |
torch_dtype=dtype
|
55 |
-
).to(
|
|
|
56 |
|
57 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
58 |
|
@@ -244,6 +245,7 @@ def infer_with_lora(input_image, prompt, selected_index, custom_lora, seed=42, r
|
|
244 |
print(f"Error during inference: {e}")
|
245 |
return None, seed, gr.update(visible=False)
|
246 |
|
|
|
247 |
# CSS styling
|
248 |
css = """
|
249 |
#main_app {
|
|
|
52 |
kontext_model,
|
53 |
quantization_config=quant_config,
|
54 |
torch_dtype=dtype
|
55 |
+
).to("cuda")
|
56 |
+
torch.cuda.empty_cache()
|
57 |
|
58 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
59 |
|
|
|
245 |
print(f"Error during inference: {e}")
|
246 |
return None, seed, gr.update(visible=False)
|
247 |
|
248 |
+
infer_with_lora.zerogpu = True
|
249 |
# CSS styling
|
250 |
css = """
|
251 |
#main_app {
|