Spaces:
Running
on
Zero
Running
on
Zero
Update image size notice
Browse files
app.py
CHANGED
|
@@ -12,6 +12,7 @@ import numpy as np
|
|
| 12 |
from PIL import Image
|
| 13 |
import tempfile
|
| 14 |
import gc
|
|
|
|
| 15 |
|
| 16 |
from addit_flux_pipeline import AdditFluxPipeline
|
| 17 |
from addit_flux_transformer import AdditFluxTransformer2DModel
|
|
@@ -87,6 +88,16 @@ def process_generated_image(
|
|
| 87 |
if error_msg:
|
| 88 |
return None, None, error_msg
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
try:
|
| 91 |
# Parse blend steps
|
| 92 |
if blend_steps.strip():
|
|
@@ -147,6 +158,18 @@ def process_real_image(
|
|
| 147 |
if error_msg:
|
| 148 |
return None, None, error_msg
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
try:
|
| 151 |
# Resize source image
|
| 152 |
source_image = source_image.resize((1024, 1024))
|
|
@@ -295,6 +318,7 @@ def create_interface():
|
|
| 295 |
# Real Images Tab
|
| 296 |
with gr.TabItem("📸 Real Images"):
|
| 297 |
gr.Markdown("### Upload an image and add objects to it")
|
|
|
|
| 298 |
|
| 299 |
with gr.Row():
|
| 300 |
with gr.Column(scale=1):
|
|
|
|
| 12 |
from PIL import Image
|
| 13 |
import tempfile
|
| 14 |
import gc
|
| 15 |
+
from datetime import datetime
|
| 16 |
|
| 17 |
from addit_flux_pipeline import AdditFluxPipeline
|
| 18 |
from addit_flux_transformer import AdditFluxTransformer2DModel
|
|
|
|
| 88 |
if error_msg:
|
| 89 |
return None, None, error_msg
|
| 90 |
|
| 91 |
+
# Print current time and input information
|
| 92 |
+
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 93 |
+
print(f"\n[{current_time}] Starting Generated Image Processing")
|
| 94 |
+
print(f"Source Prompt: '{prompt_source}'")
|
| 95 |
+
print(f"Target Prompt: '{prompt_target}'")
|
| 96 |
+
print(f"Subject Token: '{subject_token}'")
|
| 97 |
+
print(f"Source Seed: {seed_src}, Object Seed: {seed_obj}")
|
| 98 |
+
print(f"Extended Scale: {extended_scale}, Structure Transfer Step: {structure_transfer_step}")
|
| 99 |
+
print(f"Blend Steps: '{blend_steps}', Localization Model: '{localization_model}'")
|
| 100 |
+
|
| 101 |
try:
|
| 102 |
# Parse blend steps
|
| 103 |
if blend_steps.strip():
|
|
|
|
| 158 |
if error_msg:
|
| 159 |
return None, None, error_msg
|
| 160 |
|
| 161 |
+
# Print current time and input information
|
| 162 |
+
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
| 163 |
+
print(f"\n[{current_time}] Starting Real Image Processing")
|
| 164 |
+
print(f"Source Image Size: {source_image.size}")
|
| 165 |
+
print(f"Source Prompt: '{prompt_source}'")
|
| 166 |
+
print(f"Target Prompt: '{prompt_target}'")
|
| 167 |
+
print(f"Subject Token: '{subject_token}'")
|
| 168 |
+
print(f"Source Seed: {seed_src}, Object Seed: {seed_obj}")
|
| 169 |
+
print(f"Extended Scale: {extended_scale}, Structure Transfer Step: {structure_transfer_step}")
|
| 170 |
+
print(f"Blend Steps: '{blend_steps}', Localization Model: '{localization_model}'")
|
| 171 |
+
print(f"Use Offset: {use_offset}, Disable Inversion: {disable_inversion}")
|
| 172 |
+
|
| 173 |
try:
|
| 174 |
# Resize source image
|
| 175 |
source_image = source_image.resize((1024, 1024))
|
|
|
|
| 318 |
# Real Images Tab
|
| 319 |
with gr.TabItem("📸 Real Images"):
|
| 320 |
gr.Markdown("### Upload an image and add objects to it")
|
| 321 |
+
gr.HTML("<p style='color: red; font-weight: bold; margin: -15px -10px;'>Note: Images will be resized to 1024x1024 pixels. For best results, use square images.</p>")
|
| 322 |
|
| 323 |
with gr.Row():
|
| 324 |
with gr.Column(scale=1):
|