Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ def apply_patch():
|
|
| 16 |
patch_file = os.path.join(os.path.dirname(__file__), "flux2_klein_kv.patch")
|
| 17 |
if os.path.exists(patch_file):
|
| 18 |
result = subprocess.run(
|
| 19 |
-
["patch", "-
|
| 20 |
cwd=os.path.dirname(site_packages), # ← cwd is site-packages, not its parent
|
| 21 |
stdin=open(patch_file),
|
| 22 |
capture_output=True,
|
|
@@ -33,7 +33,7 @@ import gradio as gr
|
|
| 33 |
import numpy as np
|
| 34 |
import torch
|
| 35 |
from PIL import Image
|
| 36 |
-
from diffusers import Flux2KleinKVPipeline
|
| 37 |
from huggingface_hub import InferenceClient
|
| 38 |
|
| 39 |
dtype = torch.bfloat16
|
|
|
|
| 16 |
patch_file = os.path.join(os.path.dirname(__file__), "flux2_klein_kv.patch")
|
| 17 |
if os.path.exists(patch_file):
|
| 18 |
result = subprocess.run(
|
| 19 |
+
["patch", "-p2", "--forward", "--batch"], # ← p3 strips a/src/diffusers/ prefix
|
| 20 |
cwd=os.path.dirname(site_packages), # ← cwd is site-packages, not its parent
|
| 21 |
stdin=open(patch_file),
|
| 22 |
capture_output=True,
|
|
|
|
| 33 |
import numpy as np
|
| 34 |
import torch
|
| 35 |
from PIL import Image
|
| 36 |
+
from diffusers.pipelines.flux2.pipeline_flux2_klein_kv import Flux2KleinKVPipeline
|
| 37 |
from huggingface_hub import InferenceClient
|
| 38 |
|
| 39 |
dtype = torch.bfloat16
|