Spaces:
Running on Zero
Running on Zero
update app
Browse files
app.py
CHANGED
|
@@ -138,28 +138,6 @@ def update_dimensions_from_image(image_list):
|
|
| 138 |
new_height = max(256, min(1024, round(new_height / 8) * 8))
|
| 139 |
return new_width, new_height
|
| 140 |
|
| 141 |
-
|
| 142 |
-
def get_example_items():
|
| 143 |
-
example_prompts = {
|
| 144 |
-
"1.jpg": "Change the weather to stormy.",
|
| 145 |
-
"2.jpg": "Transform the scene into a snowy winter day while preserving the original subject identity, framing, and composition.",
|
| 146 |
-
"3.jpg": "Relight the image with soft golden sunset lighting while keeping all structures and subject details consistent.",
|
| 147 |
-
"4.jpg": "Make the texture high-resolution.",
|
| 148 |
-
}
|
| 149 |
-
items = []
|
| 150 |
-
if EXAMPLES_DIR.exists():
|
| 151 |
-
for name in sorted(os.listdir(EXAMPLES_DIR)):
|
| 152 |
-
if name.lower().endswith((".png", ".jpg", ".jpeg", ".webp")):
|
| 153 |
-
items.append({
|
| 154 |
-
"file": name,
|
| 155 |
-
"path": str(EXAMPLES_DIR / name),
|
| 156 |
-
"prompt": example_prompts.get(
|
| 157 |
-
name, "Edit this image while preserving composition."
|
| 158 |
-
),
|
| 159 |
-
})
|
| 160 |
-
return items
|
| 161 |
-
|
| 162 |
-
|
| 163 |
def parse_input_images(input_images):
|
| 164 |
"""Safely parse gallery / filepath / PIL inputs → list[PIL.Image] or None."""
|
| 165 |
if input_images is None:
|
|
|
|
| 138 |
new_height = max(256, min(1024, round(new_height / 8) * 8))
|
| 139 |
return new_width, new_height
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
def parse_input_images(input_images):
|
| 142 |
"""Safely parse gallery / filepath / PIL inputs → list[PIL.Image] or None."""
|
| 143 |
if input_images is None:
|