Yw22 commited on
Commit
f55e152
1 Parent(s): d584432
Files changed (1) hide show
  1. app.py +28 -91
app.py CHANGED
@@ -116,87 +116,32 @@ os.system(f'mv models/personalized/TUSUN.safetensors?download=true models/person
116
 
117
  # - - - - - examples - - - - - #
118
 
119
- # image_examples = [
120
- # ["__asset__/images/object/turtle-1.jpg",
121
- # "a sea turtle gracefully swimming over a coral reef in the clear blue ocean.",
122
- # "object",
123
- # 11318446767408804497,
124
- # "",
125
- # json.load(open("__asset__/trajs/object/turtle-1.json")),
126
- # "__asset__/images/object/turtle-1.jpg",
127
- # ],
128
-
129
- # ["__asset__/images/object/rose-1.jpg",
130
- # "a red rose engulfed in flames.",
131
- # "object",
132
- # 6854275249656120509,
133
- # "",
134
- # json.load(open("__asset__/trajs/object/rose-1.json")),
135
- # "__asset__/images/object/rose-1.jpg",
136
- # ],
137
-
138
- # ["__asset__/images/object/jellyfish-1.jpg",
139
- # "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.",
140
- # "object",
141
- # 17966188172968903484,
142
- # "HelloObject",
143
- # json.load(open("__asset__/trajs/object/jellyfish-1.json")),
144
- # "__asset__/images/object/jellyfish-1.jpg",
145
- # ],
146
-
147
-
148
- # ["__asset__/images/camera/lush-1.jpg",
149
- # "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.",
150
- # "camera",
151
- # 7970487946960948963,
152
- # "HelloObject",
153
- # json.load(open("__asset__/trajs/camera/lush-1.json")),
154
- # "__asset__/images/camera/lush-1.jpg",
155
- # ],
156
-
157
- # ["__asset__/images/camera/tusun-1.jpg",
158
- # "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.",
159
- # "camera",
160
- # 996953226890228361,
161
- # "TUSUN",
162
- # json.load(open("__asset__/trajs/camera/tusun-1.json")),
163
- # "__asset__/images/camera/tusun-1.jpg",
164
- # ],
165
-
166
- # ["__asset__/images/camera/painting-1.jpg",
167
- # "A oil painting.",
168
- # "camera",
169
- # 16867854766769816385,
170
- # "",
171
- # json.load(open("__asset__/trajs/camera/painting-1.json")),
172
- # "__asset__/images/camera/painting-1.jpg",
173
- # ],
174
-
175
- # ]
176
-
177
  image_examples = [
178
  ["__asset__/images/object/turtle-1.jpg",
179
  "a sea turtle gracefully swimming over a coral reef in the clear blue ocean.",
180
  "object",
181
  11318446767408804497,
182
- # json.load(open("__asset__/trajs/object/turtle-1.json")),
183
- "__asset__/trajs/object/turtle-1.json",
 
184
  ],
185
 
186
  ["__asset__/images/object/rose-1.jpg",
187
  "a red rose engulfed in flames.",
188
  "object",
189
  6854275249656120509,
190
- # json.load(open("__asset__/trajs/object/rose-1.json")),
191
- "__asset__/trajs/object/turtle-1.json",
 
192
  ],
193
 
194
  ["__asset__/images/object/jellyfish-1.jpg",
195
  "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.",
196
  "object",
197
  17966188172968903484,
198
- # json.load(open("__asset__/trajs/object/jellyfish-1.json")),
199
- "__asset__/trajs/object/turtle-1.json",
 
200
  ],
201
 
202
 
@@ -204,29 +149,33 @@ image_examples = [
204
  "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.",
205
  "camera",
206
  7970487946960948963,
207
- # json.load(open("__asset__/trajs/camera/lush-1.json")),
208
- "__asset__/trajs/object/turtle-1.json",
 
209
  ],
210
 
211
  ["__asset__/images/camera/tusun-1.jpg",
212
  "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.",
213
  "camera",
214
  996953226890228361,
215
- # json.load(open("__asset__/trajs/camera/tusun-1.json")),
216
- "__asset__/trajs/object/turtle-1.json",
 
217
  ],
218
 
219
  ["__asset__/images/camera/painting-1.jpg",
220
  "A oil painting.",
221
  "camera",
222
  16867854766769816385,
223
- # json.load(open("__asset__/trajs/camera/painting-1.json")),
224
- "__asset__/trajs/object/turtle-1.json",
 
225
  ],
226
 
227
  ]
228
 
229
 
 
230
  DREAM_BOOTH = {
231
  'HelloObject': 'models/personalized/helloobjects_V12c.safetensors',
232
  }
@@ -554,8 +503,8 @@ with block as demo:
554
  width=384,
555
  model_length=16
556
  )
557
- first_frame_path = gr.State(value=None,label="image")
558
- tracking_points = gr.State([], label="points")
559
 
560
  with gr.Row():
561
  with gr.Column(scale=1):
@@ -626,34 +575,22 @@ with block as demo:
626
 
627
 
628
  with gr.Row():
629
- # def process_example(input_image, prompt, drag_mode, seed, personalized, tracking_points, first_frame_path):
630
 
631
- # return input_image, prompt, drag_mode, seed, personalized, tracking_points, first_frame_path
632
- def process_example(input_image, prompt, drag_mode, seed, tracking_points):
633
- return input_image, prompt, drag_mode, seed, tracking_points
634
-
635
- # example = gr.Examples(
636
- # label="Input Example",
637
- # examples=image_examples,
638
- # inputs=[input_image, prompt, drag_mode, seed, personalized, tracking_points, first_frame_path],
639
- # outputs=[input_image, prompt, drag_mode, seed, personalized, tracking_points, first_frame_path],
640
- # fn=process_example,
641
- # run_on_click=True,
642
- # examples_per_page=10,
643
- # cache_examples=False,
644
- # )
645
-
646
  example = gr.Examples(
647
  label="Input Example",
648
  examples=image_examples,
649
- inputs=[input_image, prompt, drag_mode, seed, tracking_points],
650
- outputs=[input_image, prompt, drag_mode, seed, tracking_points],
651
  fn=process_example,
652
  run_on_click=True,
653
- examples_per_page=20,
654
  cache_examples=False,
655
  )
656
 
 
657
  with gr.Row():
658
  gr.Markdown(citation)
659
 
 
116
 
117
  # - - - - - examples - - - - - #
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  image_examples = [
120
  ["__asset__/images/object/turtle-1.jpg",
121
  "a sea turtle gracefully swimming over a coral reef in the clear blue ocean.",
122
  "object",
123
  11318446767408804497,
124
+ "",
125
+ json.load(open("__asset__/trajs/object/turtle-1.json")),
126
+ "__asset__/images/object/turtle-1.jpg",
127
  ],
128
 
129
  ["__asset__/images/object/rose-1.jpg",
130
  "a red rose engulfed in flames.",
131
  "object",
132
  6854275249656120509,
133
+ "",
134
+ json.load(open("__asset__/trajs/object/rose-1.json")),
135
+ "__asset__/images/object/rose-1.jpg",
136
  ],
137
 
138
  ["__asset__/images/object/jellyfish-1.jpg",
139
  "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.",
140
  "object",
141
  17966188172968903484,
142
+ "HelloObject",
143
+ json.load(open("__asset__/trajs/object/jellyfish-1.json")),
144
+ "__asset__/images/object/jellyfish-1.jpg",
145
  ],
146
 
147
 
 
149
  "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.",
150
  "camera",
151
  7970487946960948963,
152
+ "HelloObject",
153
+ json.load(open("__asset__/trajs/camera/lush-1.json")),
154
+ "__asset__/images/camera/lush-1.jpg",
155
  ],
156
 
157
  ["__asset__/images/camera/tusun-1.jpg",
158
  "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.",
159
  "camera",
160
  996953226890228361,
161
+ "TUSUN",
162
+ json.load(open("__asset__/trajs/camera/tusun-1.json")),
163
+ "__asset__/images/camera/tusun-1.jpg",
164
  ],
165
 
166
  ["__asset__/images/camera/painting-1.jpg",
167
  "A oil painting.",
168
  "camera",
169
  16867854766769816385,
170
+ "",
171
+ json.load(open("__asset__/trajs/camera/painting-1.json")),
172
+ "__asset__/images/camera/painting-1.jpg",
173
  ],
174
 
175
  ]
176
 
177
 
178
+
179
  DREAM_BOOTH = {
180
  'HelloObject': 'models/personalized/helloobjects_V12c.safetensors',
181
  }
 
503
  width=384,
504
  model_length=16
505
  )
506
+ first_frame_path = gr.State(value=None,label="")
507
+ tracking_points = gr.State([], label="")
508
 
509
  with gr.Row():
510
  with gr.Column(scale=1):
 
575
 
576
 
577
  with gr.Row():
578
+ def process_example(input_image, prompt, drag_mode, seed, personalized, tracking_points, first_frame_path):
579
 
580
+ return input_image, prompt, drag_mode, seed, personalized, tracking_points, first_frame_path
581
+
 
 
 
 
 
 
 
 
 
 
 
 
 
582
  example = gr.Examples(
583
  label="Input Example",
584
  examples=image_examples,
585
+ inputs=[input_image, prompt, drag_mode, seed, personalized, tracking_points, first_frame_path],
586
+ outputs=[input_image, prompt, drag_mode, seed, personalized, tracking_points, first_frame_path],
587
  fn=process_example,
588
  run_on_click=True,
589
+ examples_per_page=10,
590
  cache_examples=False,
591
  )
592
 
593
+
594
  with gr.Row():
595
  gr.Markdown(citation)
596