Vnmrsharma commited on
Commit
ce3abb5
·
verified ·
1 Parent(s): 4f9e375

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -31,6 +31,26 @@ def throttle():
31
  time.sleep(CALL_INTERVAL - elapsed)
32
  _last_call_time = time.time()
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  # Detailed prompt variations for different backgrounds/angles
35
  def process_variation(variation, input_image, product_name):
36
  # Throttle to respect API rate limit
 
31
  time.sleep(CALL_INTERVAL - elapsed)
32
  _last_call_time = time.time()
33
 
34
+
35
+ PROMPT_VARIATIONS = [
36
+ # 1: White background
37
+ "Chain-of-Thought: Step 1: Carefully analyze the input image and document every single detail of the product—text, colour, material finish, branding, dimensions, and any embellishments—ensuring no detail is overlooked. Step 2: Generate a highly professional 800×800px image with a pure white background and bright natural lighting, strictly preserving the product’s text, colour, shape and finish exactly as in the original image, with zero alterations. Step 3: Rigorously verify pixel-by-pixel that the output matches the original product data 100 %, then deliver a ready-for-e-commerce upload image.",
38
+ # 2: Chnaged
39
+ "Chain-of-Thought: Step 1: Meticulously analyze the input image and record every product detail—text, colour, material finish, branding, dimensions, texture, and any embellishments—ensuring nothing is overlooked. Step 2: Generate a highly professional 800×800px image of the product from a precise 45° top-down angle against a green garden background with even lighting, strictly preserving the product’s text, colours, shape and finish exactly as in the original image, with zero alterations. Step 3: Perform a rigorous pixel-level comparison to confirm 100 % fidelity to the original product data and deliver an e-commerce–ready image.",
40
+ # 3: Slightly elevated angle, modern indoor
41
+ "Chain-of-Thought: Step 1: Scrutinize the input image to record every element of the product—text, colour palette, material finish, and branding—without exception. Step 2: Generate a highly professional 800×800px image from a slightly elevated angle and open lid if the product have a lid in a modern indoor setting with warm lighting, strictly preserving the product’s original text, colours and all details exactly as in the source. Step 3: Double-check at full resolution that no aspect of the product has been altered and that the image is e-commerce ready.",
42
+ # 4: Low angle, cool ambient lighting
43
+ "Chain-of-Thought: Step 1: Analyze the input image pixel-for-pixel to note every product detail—text, colour, texture, finish, branding and proportions—ensuring nothing is missed. Step 2: Generate a highly professional 800×800px image using a A serene, spa-like setting with elements of tranquility like smooth stones, bamboo, and a calming water feature, ideal for wellness or beauty products. background, with the product’s text, colours, materials and details preserved exactly as in the original. Step 3: Verify 100 % fidelity at the pixel level and confirm readiness for online catalog upload.",
44
+ # 5: Vibrant outdoor background
45
+ "Chain-of-Thought: Step 1: Inspect the input image meticulously and record every detail—text, colour gradients, material texture, and branding—ensuring total accuracy. Step 2: Generate a highly professional 800×800px image with a vibrant outdoor background and natural sunlight, strictly preserving the product’s original text, colours, finish and all details unchanged. Step 3: Validate that the final image is flawless, matches the original exactly, and is optimized for e-commerce display.",
46
+ # 6: Subtle gradient background
47
+ "Chain-of-Thought: Step 1: Review the input image thoroughly, capturing and logging every detail—text, colour accuracy, surface finish, and branding—100 % intact. Step 2: Generate a highly professional 800×800px image with a subtle gradient background and soft diffused lighting, ensuring that the product’s text, colours and all design details remain precisely as in the source. Step 3: Perform a pixel-level check to confirm no alterations and that the image meets e-commerce quality standards.",
48
+ # 7: Artistic abstract background
49
+ "Chain-of-Thought: Step 1: Examine the original product image in depth, noting every detail—text, colour tones, material texture, branding logos and dimensions—with absolute precision. Step 2: Generate a highly professional 800×800px image featuring an abstract background with perfect lighting, strictly preserving the product’s text, colours and every fine detail exactly as in the original. Step 3: Verify pixel-perfect fidelity and confirm the output is upload-ready for an online store.",
50
+ # 9: Rich lifestyle background
51
+ "Chain-of-Thought: Step 1: Scrutinize the input image in full detail, logging every aspect of the product—text, colour accuracy, branding, material texture, finish, and proportions—to guarantee total fidelity. Step 2: Generate a highly professional 800×800px image of the product placed A cozy, homely setting with a comfortable, inviting ambiance, featuring elements like soft lighting, plush textiles, and warm tones, suitable for home goods or comfort products. ensuring that the product’s text, colours, materials and every detail remain exactly as in the original image without any modification. Step 3: Validate at the pixel level that the output matches the original image perfectly and confirm readiness for online catalog upload.",
52
+ ]
53
+
54
  # Detailed prompt variations for different backgrounds/angles
55
  def process_variation(variation, input_image, product_name):
56
  # Throttle to respect API rate limit