Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -230,16 +230,16 @@ def create_demo(model_name: str, device: str = "cuda" if torch.cuda.is_available
|
|
230 |
return demo
|
231 |
|
232 |
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
demo = create_demo("flux-dev", "cuda", False)
|
245 |
-
demo.launch()
|
|
|
230 |
return demo
|
231 |
|
232 |
|
233 |
+
if __name__ == "__main__":
|
234 |
+
import argparse
|
235 |
+
parser = argparse.ArgumentParser(description="Flux")
|
236 |
+
parser.add_argument("--name", type=str, default="flux-dev", choices=list(configs.keys()), help="Model name")
|
237 |
+
parser.add_argument("--device", type=str, default="cuda" if torch.cuda.is_available() else "cpu", help="Device to use")
|
238 |
+
parser.add_argument("--offload", action="store_true", help="Offload model to CPU when not in use")
|
239 |
+
parser.add_argument("--share", action="store_true", help="Create a public link to your demo")
|
240 |
+
|
241 |
+
parser.add_argument("--port", type=int, default=41035)
|
242 |
+
args = parser.parse_args()
|
243 |
+
|
244 |
+
demo = create_demo("flux-dev", "cuda", False)
|
245 |
+
demo.launch()
|