Update app.py
Browse files
app.py
CHANGED
@@ -54,8 +54,6 @@ def generate_image(enhanced_caption, seed, num_inference_steps, guidance_scale):
|
|
54 |
"""Generate image using LeX-FLUX"""
|
55 |
# Truncate the caption if it's too long
|
56 |
# enhanced_caption = truncate_caption_by_tokens(enhanced_caption, max_tokens=256)
|
57 |
-
|
58 |
-
print(f"enhanced caption:\n{enhanced_caption}")
|
59 |
|
60 |
generator = torch.Generator("cpu").manual_seed(seed) if seed != 0 else None
|
61 |
|
@@ -85,6 +83,7 @@ def run_pipeline(image_caption, text_caption, seed, num_inference_steps, guidanc
|
|
85 |
if enable_enhancer:
|
86 |
# combined_caption, enhanced_caption = generate_enhanced_caption(image_caption, text_caption)
|
87 |
combined_caption, enhanced_caption = prompt_enhance(client, image_caption, text_caption)
|
|
|
88 |
else:
|
89 |
enhanced_caption = combined_caption
|
90 |
|
@@ -97,7 +96,7 @@ with gr.Blocks() as demo:
|
|
97 |
client = gr.State()
|
98 |
gr.Markdown("# LeX-Enhancer & LeX-FLUX Demo")
|
99 |
gr.Markdown("## Project Page: https://zhaoshitian.github.io/lexart/")
|
100 |
-
gr.Markdown("Generate enhanced captions from simple image and text descriptions, then create images with LeX-
|
101 |
|
102 |
with gr.Row():
|
103 |
with gr.Column():
|
|
|
54 |
"""Generate image using LeX-FLUX"""
|
55 |
# Truncate the caption if it's too long
|
56 |
# enhanced_caption = truncate_caption_by_tokens(enhanced_caption, max_tokens=256)
|
|
|
|
|
57 |
|
58 |
generator = torch.Generator("cpu").manual_seed(seed) if seed != 0 else None
|
59 |
|
|
|
83 |
if enable_enhancer:
|
84 |
# combined_caption, enhanced_caption = generate_enhanced_caption(image_caption, text_caption)
|
85 |
combined_caption, enhanced_caption = prompt_enhance(client, image_caption, text_caption)
|
86 |
+
print(f"enhanced caption:\n{enhanced_caption}")
|
87 |
else:
|
88 |
enhanced_caption = combined_caption
|
89 |
|
|
|
96 |
client = gr.State()
|
97 |
gr.Markdown("# LeX-Enhancer & LeX-FLUX Demo")
|
98 |
gr.Markdown("## Project Page: https://zhaoshitian.github.io/lexart/")
|
99 |
+
gr.Markdown("Generate enhanced captions from simple image and text descriptions, then create images with LeX-FLUX")
|
100 |
|
101 |
with gr.Row():
|
102 |
with gr.Column():
|