multimodalart HF Staff commited on
Commit
c211492
·
verified ·
1 Parent(s): ba59b4f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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=120)
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=120)
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(theme=gr.themes.Citrus(), 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,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)