Spaces:
Running on Zero
Running on Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ pipe_t2i = MageFlowPipeline.from_pretrained(T2I_MODEL, device="cuda")
|
|
| 22 |
pipe_edit = MageFlowPipeline.from_pretrained(EDIT_MODEL, device="cuda")
|
| 23 |
|
| 24 |
|
| 25 |
-
@spaces.GPU(duration=
|
| 26 |
def generate(
|
| 27 |
prompt: str,
|
| 28 |
negative_prompt: str,
|
|
@@ -58,7 +58,7 @@ def generate(
|
|
| 58 |
return img
|
| 59 |
|
| 60 |
|
| 61 |
-
@spaces.GPU(duration=
|
| 62 |
def edit(
|
| 63 |
prompt: str,
|
| 64 |
negative_prompt: str,
|
|
@@ -106,7 +106,7 @@ CSS = """
|
|
| 106 |
.dark .gradio-container { color: var(--body-text-color); }
|
| 107 |
"""
|
| 108 |
|
| 109 |
-
with gr.Blocks(
|
| 110 |
gr.Markdown(
|
| 111 |
"# Mage-Flow\n"
|
| 112 |
"Efficient Native-Resolution Foundation Model for Image Generation and Editing.\n\n"
|
|
@@ -206,4 +206,4 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=CSS) as demo:
|
|
| 206 |
)
|
| 207 |
|
| 208 |
if __name__ == "__main__":
|
| 209 |
-
demo.launch(mcp_server=True)
|
|
|
|
| 22 |
pipe_edit = MageFlowPipeline.from_pretrained(EDIT_MODEL, device="cuda")
|
| 23 |
|
| 24 |
|
| 25 |
+
@spaces.GPU(duration=60)
|
| 26 |
def generate(
|
| 27 |
prompt: str,
|
| 28 |
negative_prompt: str,
|
|
|
|
| 58 |
return img
|
| 59 |
|
| 60 |
|
| 61 |
+
@spaces.GPU(duration=60)
|
| 62 |
def edit(
|
| 63 |
prompt: str,
|
| 64 |
negative_prompt: str,
|
|
|
|
| 106 |
.dark .gradio-container { color: var(--body-text-color); }
|
| 107 |
"""
|
| 108 |
|
| 109 |
+
with gr.Blocks(css=CSS) as demo:
|
| 110 |
gr.Markdown(
|
| 111 |
"# Mage-Flow\n"
|
| 112 |
"Efficient Native-Resolution Foundation Model for Image Generation and Editing.\n\n"
|
|
|
|
| 206 |
)
|
| 207 |
|
| 208 |
if __name__ == "__main__":
|
| 209 |
+
demo.launch(theme=gr.themes.Citrus(), mcp_server=True, show_error=True)
|