Yw22 commited on
Commit
fe1e69e
1 Parent(s): aaf55b8
Files changed (3) hide show
  1. README.md +1 -2
  2. app-12.py → app-23.py +62 -61
  3. app.py +53 -54
README.md CHANGED
@@ -4,10 +4,9 @@ emoji: 🪄
4
  colorFrom: blue
5
  colorTo: blue
6
  sdk: gradio
7
- sdk_version: 4.37.2
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
  ---
12
-
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
4
  colorFrom: blue
5
  colorTo: blue
6
  sdk: gradio
7
+ sdk_version: 4.7.0
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
  ---
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app-12.py → app-23.py RENAMED
@@ -150,69 +150,70 @@ image_examples = [
150
  "object",
151
  11318446767408804497,
152
  "",
153
- "turtle"
 
154
  ],
155
 
156
- ["__asset__/images/object/rose-1.jpg",
157
- "a red rose engulfed in flames.",
158
- "object",
159
- 6854275249656120509,
160
- "",
161
- "rose",
162
- ],
163
 
164
- ["__asset__/images/object/jellyfish-1.jpg",
165
- "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.",
166
- "object",
167
- 17966188172968903484,
168
- "HelloObject",
169
- "jellyfish"
170
- ],
171
 
172
 
173
- ["__asset__/images/camera/lush-1.jpg",
174
- "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.",
175
- "camera",
176
- 7970487946960948963,
177
- "HelloObject",
178
- "lush",
179
- ],
180
 
181
- ["__asset__/images/camera/tusun-1.jpg",
182
- "tusuncub with its mouth open, blurry, open mouth, fangs, photo background, looking at viewer, tongue, full body, solo, cute and lovely, Beautiful and realistic eye details, perfect anatomy, Nonsense, pure background, Centered-Shot, realistic photo, photograph, 4k, hyper detailed, DSLR, 24 Megapixels, 8mm Lens, Full Frame, film grain, Global Illumination, studio Lighting, Award Winning Photography, diffuse reflection, ray tracing.",
183
- "camera",
184
- 996953226890228361,
185
- "TUSUN",
186
- "tusun",
187
- ],
188
 
189
- ["__asset__/images/camera/painting-1.jpg",
190
- "A oil painting.",
191
- "camera",
192
- 16867854766769816385,
193
- "",
194
- "painting"
195
- ],
196
  ]
197
 
198
 
199
- POINTS = {
200
- 'turtle': "__asset__/trajs/object/turtle-1.json",
201
- 'rose': "__asset__/trajs/object/rose-1.json",
202
- 'jellyfish': "__asset__/trajs/object/jellyfish-1.json",
203
- 'lush': "__asset__/trajs/camera/lush-1.json",
204
- 'tusun': "__asset__/trajs/camera/tusun-1.json",
205
- 'painting': "__asset__/trajs/camera/painting-1.json",
206
- }
207
 
208
- IMAGE_PATH = {
209
- 'turtle': "__asset__/images/object/turtle-1.jpg",
210
- 'rose': "__asset__/images/object/rose-1.jpg",
211
- 'jellyfish': "__asset__/images/object/jellyfish-1.jpg",
212
- 'lush': "__asset__/images/camera/lush-1.jpg",
213
- 'tusun': "__asset__/images/camera/tusun-1.jpg",
214
- 'painting': "__asset__/images/camera/painting-1.jpg",
215
- }
216
 
217
 
218
 
@@ -303,14 +304,14 @@ class ImageConductor:
303
  @spaces.GPU(duration=120)
304
  def run(self, first_frame_path, tracking_points, prompt, drag_mode, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, personalized, examples_type):
305
  print("Run!")
306
- if examples_type != "":
307
- ### for adapting high version gradio
308
- tracking_points = gr.State([])
309
- first_frame_path = IMAGE_PATH[examples_type]
310
- points = json.load(open(POINTS[examples_type]))
311
- tracking_points.value.extend(points)
312
- print("example first_frame_path", first_frame_path)
313
- print("example tracking_points", tracking_points.value)
314
 
315
  original_width, original_height=384, 256
316
  if isinstance(tracking_points, list):
@@ -648,7 +649,7 @@ with block:
648
  example = gr.Examples(
649
  label="Input Example",
650
  examples=image_examples,
651
- inputs=[input_image, prompt, drag_mode, seed, personalized, examples_type],
652
  examples_per_page=10,
653
  cache_examples=False,
654
  )
 
150
  "object",
151
  11318446767408804497,
152
  "",
153
+ "__asset__/images/object/turtle-1.jpg",
154
+ json.load(open("__asset__/trajs/object/turtle-1.json"))
155
  ],
156
 
157
+ # ["__asset__/images/object/rose-1.jpg",
158
+ # "a red rose engulfed in flames.",
159
+ # "object",
160
+ # 6854275249656120509,
161
+ # "",
162
+ # "rose",
163
+ # ],
164
 
165
+ # ["__asset__/images/object/jellyfish-1.jpg",
166
+ # "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.",
167
+ # "object",
168
+ # 17966188172968903484,
169
+ # "HelloObject",
170
+ # "jellyfish"
171
+ # ],
172
 
173
 
174
+ # ["__asset__/images/camera/lush-1.jpg",
175
+ # "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.",
176
+ # "camera",
177
+ # 7970487946960948963,
178
+ # "HelloObject",
179
+ # "lush",
180
+ # ],
181
 
182
+ # ["__asset__/images/camera/tusun-1.jpg",
183
+ # "tusuncub with its mouth open, blurry, open mouth, fangs, photo background, looking at viewer, tongue, full body, solo, cute and lovely, Beautiful and realistic eye details, perfect anatomy, Nonsense, pure background, Centered-Shot, realistic photo, photograph, 4k, hyper detailed, DSLR, 24 Megapixels, 8mm Lens, Full Frame, film grain, Global Illumination, studio Lighting, Award Winning Photography, diffuse reflection, ray tracing.",
184
+ # "camera",
185
+ # 996953226890228361,
186
+ # "TUSUN",
187
+ # "tusun",
188
+ # ],
189
 
190
+ # ["__asset__/images/camera/painting-1.jpg",
191
+ # "A oil painting.",
192
+ # "camera",
193
+ # 16867854766769816385,
194
+ # "",
195
+ # "painting"
196
+ # ],
197
  ]
198
 
199
 
200
+ # POINTS = {
201
+ # 'turtle': "__asset__/trajs/object/turtle-1.json",
202
+ # 'rose': "__asset__/trajs/object/rose-1.json",
203
+ # 'jellyfish': "__asset__/trajs/object/jellyfish-1.json",
204
+ # 'lush': "__asset__/trajs/camera/lush-1.json",
205
+ # 'tusun': "__asset__/trajs/camera/tusun-1.json",
206
+ # 'painting': "__asset__/trajs/camera/painting-1.json",
207
+ # }
208
 
209
+ # IMAGE_PATH = {
210
+ # 'turtle': "__asset__/images/object/turtle-1.jpg",
211
+ # 'rose': "__asset__/images/object/rose-1.jpg",
212
+ # 'jellyfish': "__asset__/images/object/jellyfish-1.jpg",
213
+ # 'lush': "__asset__/images/camera/lush-1.jpg",
214
+ # 'tusun': "__asset__/images/camera/tusun-1.jpg",
215
+ # 'painting': "__asset__/images/camera/painting-1.jpg",
216
+ # }
217
 
218
 
219
 
 
304
  @spaces.GPU(duration=120)
305
  def run(self, first_frame_path, tracking_points, prompt, drag_mode, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, personalized, examples_type):
306
  print("Run!")
307
+ # if examples_type != "":
308
+ # ### for adapting high version gradio
309
+ # tracking_points = gr.State([])
310
+ # first_frame_path = IMAGE_PATH[examples_type]
311
+ # points = json.load(open(POINTS[examples_type]))
312
+ # tracking_points.value.extend(points)
313
+ # print("example first_frame_path", first_frame_path)
314
+ # print("example tracking_points", tracking_points.value)
315
 
316
  original_width, original_height=384, 256
317
  if isinstance(tracking_points, list):
 
649
  example = gr.Examples(
650
  label="Input Example",
651
  examples=image_examples,
652
+ inputs=[input_image, prompt, drag_mode, seed, personalized, first_frame_path_var, tracking_points_var],
653
  examples_per_page=10,
654
  cache_examples=False,
655
  )
app.py CHANGED
@@ -150,70 +150,69 @@ image_examples = [
150
  "object",
151
  11318446767408804497,
152
  "",
153
- "__asset__/images/object/turtle-1.jpg",
154
- json.load(open("__asset__/trajs/object/turtle-1.json"))
155
  ],
156
 
157
- # ["__asset__/images/object/rose-1.jpg",
158
- # "a red rose engulfed in flames.",
159
- # "object",
160
- # 6854275249656120509,
161
- # "",
162
- # "rose",
163
- # ],
164
 
165
- # ["__asset__/images/object/jellyfish-1.jpg",
166
- # "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.",
167
- # "object",
168
- # 17966188172968903484,
169
- # "HelloObject",
170
- # "jellyfish"
171
- # ],
172
 
173
 
174
- # ["__asset__/images/camera/lush-1.jpg",
175
- # "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.",
176
- # "camera",
177
- # 7970487946960948963,
178
- # "HelloObject",
179
- # "lush",
180
- # ],
181
 
182
- # ["__asset__/images/camera/tusun-1.jpg",
183
- # "tusuncub with its mouth open, blurry, open mouth, fangs, photo background, looking at viewer, tongue, full body, solo, cute and lovely, Beautiful and realistic eye details, perfect anatomy, Nonsense, pure background, Centered-Shot, realistic photo, photograph, 4k, hyper detailed, DSLR, 24 Megapixels, 8mm Lens, Full Frame, film grain, Global Illumination, studio Lighting, Award Winning Photography, diffuse reflection, ray tracing.",
184
- # "camera",
185
- # 996953226890228361,
186
- # "TUSUN",
187
- # "tusun",
188
- # ],
189
 
190
- # ["__asset__/images/camera/painting-1.jpg",
191
- # "A oil painting.",
192
- # "camera",
193
- # 16867854766769816385,
194
- # "",
195
- # "painting"
196
- # ],
197
  ]
198
 
199
 
200
- # POINTS = {
201
- # 'turtle': "__asset__/trajs/object/turtle-1.json",
202
- # 'rose': "__asset__/trajs/object/rose-1.json",
203
- # 'jellyfish': "__asset__/trajs/object/jellyfish-1.json",
204
- # 'lush': "__asset__/trajs/camera/lush-1.json",
205
- # 'tusun': "__asset__/trajs/camera/tusun-1.json",
206
- # 'painting': "__asset__/trajs/camera/painting-1.json",
207
- # }
208
 
209
- # IMAGE_PATH = {
210
- # 'turtle': "__asset__/images/object/turtle-1.jpg",
211
- # 'rose': "__asset__/images/object/rose-1.jpg",
212
- # 'jellyfish': "__asset__/images/object/jellyfish-1.jpg",
213
- # 'lush': "__asset__/images/camera/lush-1.jpg",
214
- # 'tusun': "__asset__/images/camera/tusun-1.jpg",
215
- # 'painting': "__asset__/images/camera/painting-1.jpg",
216
- # }
217
 
218
 
219
 
@@ -649,7 +648,7 @@ with block:
649
  example = gr.Examples(
650
  label="Input Example",
651
  examples=image_examples,
652
- inputs=[input_image, prompt, drag_mode, seed, personalized, first_frame_path_var, tracking_points_var],
653
  examples_per_page=10,
654
  cache_examples=False,
655
  )
 
150
  "object",
151
  11318446767408804497,
152
  "",
153
+ "turtle"
 
154
  ],
155
 
156
+ ["__asset__/images/object/rose-1.jpg",
157
+ "a red rose engulfed in flames.",
158
+ "object",
159
+ 6854275249656120509,
160
+ "",
161
+ "rose",
162
+ ],
163
 
164
+ ["__asset__/images/object/jellyfish-1.jpg",
165
+ "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.",
166
+ "object",
167
+ 17966188172968903484,
168
+ "HelloObject",
169
+ "jellyfish"
170
+ ],
171
 
172
 
173
+ ["__asset__/images/camera/lush-1.jpg",
174
+ "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.",
175
+ "camera",
176
+ 7970487946960948963,
177
+ "HelloObject",
178
+ "lush",
179
+ ],
180
 
181
+ ["__asset__/images/camera/tusun-1.jpg",
182
+ "tusuncub with its mouth open, blurry, open mouth, fangs, photo background, looking at viewer, tongue, full body, solo, cute and lovely, Beautiful and realistic eye details, perfect anatomy, Nonsense, pure background, Centered-Shot, realistic photo, photograph, 4k, hyper detailed, DSLR, 24 Megapixels, 8mm Lens, Full Frame, film grain, Global Illumination, studio Lighting, Award Winning Photography, diffuse reflection, ray tracing.",
183
+ "camera",
184
+ 996953226890228361,
185
+ "TUSUN",
186
+ "tusun",
187
+ ],
188
 
189
+ ["__asset__/images/camera/painting-1.jpg",
190
+ "A oil painting.",
191
+ "camera",
192
+ 16867854766769816385,
193
+ "",
194
+ "painting"
195
+ ],
196
  ]
197
 
198
 
199
+ POINTS = {
200
+ 'turtle': "__asset__/trajs/object/turtle-1.json",
201
+ 'rose': "__asset__/trajs/object/rose-1.json",
202
+ 'jellyfish': "__asset__/trajs/object/jellyfish-1.json",
203
+ 'lush': "__asset__/trajs/camera/lush-1.json",
204
+ 'tusun': "__asset__/trajs/camera/tusun-1.json",
205
+ 'painting': "__asset__/trajs/camera/painting-1.json",
206
+ }
207
 
208
+ IMAGE_PATH = {
209
+ 'turtle': "__asset__/images/object/turtle-1.jpg",
210
+ 'rose': "__asset__/images/object/rose-1.jpg",
211
+ 'jellyfish': "__asset__/images/object/jellyfish-1.jpg",
212
+ 'lush': "__asset__/images/camera/lush-1.jpg",
213
+ 'tusun': "__asset__/images/camera/tusun-1.jpg",
214
+ 'painting': "__asset__/images/camera/painting-1.jpg",
215
+ }
216
 
217
 
218
 
 
648
  example = gr.Examples(
649
  label="Input Example",
650
  examples=image_examples,
651
+ inputs=[input_image, prompt, drag_mode, seed, personalized, examples_type],
652
  examples_per_page=10,
653
  cache_examples=False,
654
  )