Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,20 @@ from huggingface_hub import hf_hub_download
|
|
| 11 |
from aura_sr import AuraSR
|
| 12 |
from gradio_imageslider import ImageSlider
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# --- Main Model Initialization ---
|
| 15 |
MAX_SEED = np.iinfo(np.int32).max
|
| 16 |
pipe = FluxKontextPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16).to("cuda")
|
|
@@ -182,4 +196,4 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
|
| 182 |
outputs=[input_image]
|
| 183 |
)
|
| 184 |
|
| 185 |
-
demo.launch(mcp_server=True)
|
|
|
|
| 11 |
from aura_sr import AuraSR
|
| 12 |
from gradio_imageslider import ImageSlider
|
| 13 |
|
| 14 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 15 |
+
|
| 16 |
+
# --- # Device and CUDA Setup Check ---
|
| 17 |
+
print("CUDA_VISIBLE_DEVICES=", os.environ.get("CUDA_VISIBLE_DEVICES"))
|
| 18 |
+
print("torch.__version__ =", torch.__version__)
|
| 19 |
+
print("torch.version.cuda =", torch.version.cuda)
|
| 20 |
+
print("cuda available:", torch.cuda.is_available())
|
| 21 |
+
print("cuda device count:", torch.cuda.device_count())
|
| 22 |
+
if torch.cuda.is_available():
|
| 23 |
+
print("current device:", torch.cuda.current_device())
|
| 24 |
+
print("device name:", torch.cuda.get_device_name(torch.cuda.current_device()))
|
| 25 |
+
|
| 26 |
+
print("Using device:", device)
|
| 27 |
+
|
| 28 |
# --- Main Model Initialization ---
|
| 29 |
MAX_SEED = np.iinfo(np.int32).max
|
| 30 |
pipe = FluxKontextPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16).to("cuda")
|
|
|
|
| 196 |
outputs=[input_image]
|
| 197 |
)
|
| 198 |
|
| 199 |
+
demo.launch(share=True, mcp_server=True, ssr_mode=False, show_error=True)
|