prithivMLmods commited on
Commit
cef7b4f
·
verified ·
1 Parent(s): 154a35a

update app

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -138,6 +138,26 @@ 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
  def parse_input_images(input_images):
142
  """Safely parse gallery / filepath / PIL inputs → list[PIL.Image] or None."""
143
  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 get_example_items():
142
+ example_prompts = {
143
+ "1.jpg": "Change the weather to stormy.",
144
+ "2.jpg": "Transform the scene into a snowy winter day while preserving the original subject identity, framing, and composition.",
145
+ "3.jpg": "Relight the image with soft golden sunset lighting while keeping all structures and subject details consistent.",
146
+ "4.jpg": "Make the texture high-resolution.",
147
+ }
148
+ items = []
149
+ if EXAMPLES_DIR.exists():
150
+ for name in sorted(os.listdir(EXAMPLES_DIR)):
151
+ if name.lower().endswith((".png", ".jpg", ".jpeg", ".webp")):
152
+ items.append({
153
+ "file": name,
154
+ "path": str(EXAMPLES_DIR / name),
155
+ "prompt": example_prompts.get(
156
+ name, "Edit this image while preserving composition."
157
+ ),
158
+ })
159
+ return items
160
+
161
  def parse_input_images(input_images):
162
  """Safely parse gallery / filepath / PIL inputs → list[PIL.Image] or None."""
163
  if input_images is None: