Lin commited on
Commit
63f6c0c
1 Parent(s): 023f418
Files changed (1) hide show
  1. app.py +2 -46
app.py CHANGED
@@ -9,51 +9,9 @@ developer_mode = os.getenv('DEV_MODE', False)
9
  DEFAULT_POSITIVE_PROMPT = "on the pavement, poolside, idyllic infinity pool, Hawaiian hilltops, commercial product photography"
10
  DEFAULT_NEGATIVE_PROMPT = ""
11
 
12
- EXAMPLES = [
13
- [
14
- "examples/black-sneakers-with-white-sole.jpg",
15
- "on the grass in Central Park, gorgeous summer day with Bethesda fountain in the background, commercial footwear product photography",
16
- "people, litter, trash, crowds, messy",
17
- ],
18
- [
19
- "examples/DIY-beard-balm.jpg",
20
- "on a mossy rock, white wood anemone blossoms, Loch Ken, Scotland",
21
- "purple, wrong proportions",
22
- ],
23
- [
24
- "examples/dj-making-music-on-mixer.jpg",
25
- "on the turntables with a packed dance floor, epic midnight edm party in Miami Beach, colorful nightlife photography",
26
- "disfigured, dismembered, mangled, marred",
27
- ],
28
- [
29
- "examples/jean-shorts-woman.jpg",
30
- "on the beach in Malibu, a five-star beachfront hotel in the background, stark late afternoon light near the dunes, lifestyle photography",
31
- "blurry background, ripples, soft focus, bokeh",
32
- ],
33
- ]
34
-
35
- INTRO = """
36
- # Shopify Image Background Replacement
37
-
38
- [![Duplicate this Space](https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-md.svg)](https://huggingface.co/spaces/Shopify/background-replacement?duplicate=true)
39
-
40
- Building an online store requires lots of high quality product and marketing images. This is an early demo of a background replacement tool built with Stable Diffusion XL that makes it easy to use your existing product images to make something new. Please be patient during peak demand. 😅
41
-
42
- To use it, upload your product photo (.jpg or .png), then describe the background you’d like to see in place of the original. For best results follow the general pattern in the examples below:
43
- 1. ❌ _Do not_ describe your product in the prompt (ex: black sneakers)
44
- 2. ✅ Do describe the "grounding" for your product (ex: placed on a table)
45
- 3. ✅ Do describe the scene you want (ex: in a greek cottage)
46
- 4. ✅ Do describe a style of image (ex: side view commercial product photography)
47
- 5. 🤔 Optionally, describe what you want to avoid 🙅 in the negative prompt field
48
- """
49
-
50
- MORE_INFO = """
51
- ### More information
52
- - You can check our [FAQs here](https://huggingface.co/spaces/Shopify/background-replacement/blob/main/README.md#faqs)!
53
- - We are also gathering resources from the community and sharing ideas [here](https://huggingface.co/spaces/Shopify/background-replacement/discussions).
54
- - Shopify is on a mission to redefine commerce with AI. If you’re an AI or ML engineer looking to build the future of commerce, [join us](https://www.shopify.com/careers)!
55
- """
56
 
 
57
 
58
  def generate(
59
  image,
@@ -205,8 +163,6 @@ with gr.Blocks(css=custom_css) as iface:
205
  inputs=[image_upload, positive_prompt, negative_prompt],
206
  )
207
 
208
- gr.Markdown(MORE_INFO)
209
-
210
  gen_button.click(
211
  fn=generate,
212
  inputs=[
 
9
  DEFAULT_POSITIVE_PROMPT = "on the pavement, poolside, idyllic infinity pool, Hawaiian hilltops, commercial product photography"
10
  DEFAULT_NEGATIVE_PROMPT = ""
11
 
12
+ EXAMPLES = []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ INTRO = "Test."
15
 
16
  def generate(
17
  image,
 
163
  inputs=[image_upload, positive_prompt, negative_prompt],
164
  )
165
 
 
 
166
  gen_button.click(
167
  fn=generate,
168
  inputs=[