Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -318,7 +318,9 @@ def http_chat_bot(state, temperature, top_k, top_p, max_new_tokens):
|
|
| 318 |
return (state, state.to_gradio_chatbot()) + (enable_btn,) * 2
|
| 319 |
|
| 320 |
|
| 321 |
-
|
|
|
|
|
|
|
| 322 |
def http_gen_edit_bot(state, temperature, top_k, top_p, image_gen_temperature,
|
| 323 |
image_gen_top_k, image_gen_top_p, max_output_tokens,
|
| 324 |
llm_cfg_scale, resolution_wh, use_diffusion, diffusion_cfg_scale, diffusion_num_inference_steps):
|
|
@@ -559,18 +561,17 @@ title_markdown = """
|
|
| 559 |
<div>
|
| 560 |
<h1 style="margin: 0;"> ILLUME+: Illuminating Unified MLLM with Dual Visual Tokenization and Diffusion Refinement</h1>
|
| 561 |
<h2 style="margin: 10px 0;">
|
| 562 |
-
Links:
|
| 563 |
<a href="https://arxiv.org/abs/2504.01934" target="_blank" rel="noopener noreferrer">Paper</a> |
|
| 564 |
<a href="https://github.com/illume-unified-mllm/ILLUME_plus" target="_blank" rel="noopener noreferrer">Code</a> |
|
| 565 |
-
<a href="
|
| 566 |
<a href="https://illume-unified-mllm.github.io/" target="_blank" rel="noopener noreferrer">Project Page</a>
|
| 567 |
</h2>
|
| 568 |
<ul style="margin: 20px 0; padding-left: 20px;">
|
| 569 |
<li><strong>1.</strong> Enter text and/or upload an image.</li>
|
| 570 |
<li><strong>2.</strong> Click the 💬 <strong>Chat</strong> button for image inputted conversations</li>
|
| 571 |
<li><strong>3.</strong> Click the 🖼️ <strong>Generate</strong> for image generation and image editing.</li>
|
| 572 |
-
<li><strong>
|
| 573 |
-
<li><strong>
|
| 574 |
<br/><strong>💡 Tip 1:</strong> For better image generation quality, we recommend setting <code>temperature = 1.0</code>, <code>top_k = 2048</code>, <code>top_p = 1.0</code>, <code>llm_cfg = 2.0</code>.
|
| 575 |
<br/><strong>💡 Tip 2:</strong> For better image editing quality, we recommend setting <code>temperature = 0.7</code>, <code>top_k = 512</code>, <code>top_p = 0.8</code>, <code>llm_cfg = 1.5</code>.
|
| 576 |
<br/><strong>💡 Tip 3:</strong> For diffusion decoder, CFG scale of 1.5 or 2.0 is enough.
|
|
@@ -960,5 +961,4 @@ if __name__ == "__main__":
|
|
| 960 |
api_open=False
|
| 961 |
).launch(
|
| 962 |
share=args.share,
|
| 963 |
-
server_name="0.0.0.0" # Allow network access if not using --share
|
| 964 |
)
|
|
|
|
| 318 |
return (state, state.to_gradio_chatbot()) + (enable_btn,) * 2
|
| 319 |
|
| 320 |
|
| 321 |
+
|
| 322 |
+
@torch.inference_mode()
|
| 323 |
+
@spaces.GPU(duration=120) # Specify a duration to avoid timeout
|
| 324 |
def http_gen_edit_bot(state, temperature, top_k, top_p, image_gen_temperature,
|
| 325 |
image_gen_top_k, image_gen_top_p, max_output_tokens,
|
| 326 |
llm_cfg_scale, resolution_wh, use_diffusion, diffusion_cfg_scale, diffusion_num_inference_steps):
|
|
|
|
| 561 |
<div>
|
| 562 |
<h1 style="margin: 0;"> ILLUME+: Illuminating Unified MLLM with Dual Visual Tokenization and Diffusion Refinement</h1>
|
| 563 |
<h2 style="margin: 10px 0;">
|
|
|
|
| 564 |
<a href="https://arxiv.org/abs/2504.01934" target="_blank" rel="noopener noreferrer">Paper</a> |
|
| 565 |
<a href="https://github.com/illume-unified-mllm/ILLUME_plus" target="_blank" rel="noopener noreferrer">Code</a> |
|
| 566 |
+
<a href="https://huggingface.co/ILLUME-MLLM/illume_plus-qwen2_5-3b-hf" target="_blank" rel="noopener noreferrer">Model</a> |
|
| 567 |
<a href="https://illume-unified-mllm.github.io/" target="_blank" rel="noopener noreferrer">Project Page</a>
|
| 568 |
</h2>
|
| 569 |
<ul style="margin: 20px 0; padding-left: 20px;">
|
| 570 |
<li><strong>1.</strong> Enter text and/or upload an image.</li>
|
| 571 |
<li><strong>2.</strong> Click the 💬 <strong>Chat</strong> button for image inputted conversations</li>
|
| 572 |
<li><strong>3.</strong> Click the 🖼️ <strong>Generate</strong> for image generation and image editing.</li>
|
| 573 |
+
<li><strong>4.</strong> (Optional) Enable Diffusion Decoder for image super resolution decoding.
|
| 574 |
+
<li><strong>5.</strong> Adjust generation parameters if needed.
|
| 575 |
<br/><strong>💡 Tip 1:</strong> For better image generation quality, we recommend setting <code>temperature = 1.0</code>, <code>top_k = 2048</code>, <code>top_p = 1.0</code>, <code>llm_cfg = 2.0</code>.
|
| 576 |
<br/><strong>💡 Tip 2:</strong> For better image editing quality, we recommend setting <code>temperature = 0.7</code>, <code>top_k = 512</code>, <code>top_p = 0.8</code>, <code>llm_cfg = 1.5</code>.
|
| 577 |
<br/><strong>💡 Tip 3:</strong> For diffusion decoder, CFG scale of 1.5 or 2.0 is enough.
|
|
|
|
| 961 |
api_open=False
|
| 962 |
).launch(
|
| 963 |
share=args.share,
|
|
|
|
| 964 |
)
|