Spaces:
Runtime error
Runtime error
envs
Browse filesFiles changed (2)
- app-23.py → app-12.pyRenamed+64-65
- app.py+65-64
149 unmodified lines15015115215315415315415515715815916016116216315615715815916016116216316516616716816917017116416516616716816917017117217417517617717817918017317417517617717817918018218318418518618718818118218318418518618718819019119219319419519618919019119219319419519619719820020120220320420520620719920020120220320420520620720921021121221321421521620820921021121221321421521621721881 unmodified lines3003013023043033043053073083093103113123133143063073083093103113123133143153163 unmodified lines320321322324323324325326240 unmodified lines56756856957157057157257374 unmodified lines648649650652651652653654149 unmodified lines "object", 11318446767408804497, "", "__asset__/images/object/turtle-1.jpg", json.load(open("__asset__/trajs/object/turtle-1.json")) "turtle" ], # ["__asset__/images/object/rose-1.jpg", # "a red rose engulfed in flames.", # "object", # 6854275249656120509, # "", # "rose", # ], ["__asset__/images/object/rose-1.jpg", "a red rose engulfed in flames.", "object", 6854275249656120509, "", "rose", ], # ["__asset__/images/object/jellyfish-1.jpg", # "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.", # "object", # 17966188172968903484, # "HelloObject", # "jellyfish" # ], ["__asset__/images/object/jellyfish-1.jpg", "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.", "object", 17966188172968903484, "HelloObject", "jellyfish" ], # ["__asset__/images/camera/lush-1.jpg", # "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.", # "camera", # 7970487946960948963, # "HelloObject", # "lush", # ], ["__asset__/images/camera/lush-1.jpg", "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.", "camera", 7970487946960948963, "HelloObject", "lush", ], # ["__asset__/images/camera/tusun-1.jpg", # "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.", # "camera", # 996953226890228361, # "TUSUN", # "tusun", # ], ["__asset__/images/camera/tusun-1.jpg", "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.", "camera", 996953226890228361, "TUSUN", "tusun", ], # ["__asset__/images/camera/painting-1.jpg", # "A oil painting.", # "camera", # 16867854766769816385, # "", # "painting" # ], ["__asset__/images/camera/painting-1.jpg", "A oil painting.", "camera", 16867854766769816385, "", "painting" ],]
# POINTS = {# 'turtle': "__asset__/trajs/object/turtle-1.json",# 'rose': "__asset__/trajs/object/rose-1.json",# 'jellyfish': "__asset__/trajs/object/jellyfish-1.json",# 'lush': "__asset__/trajs/camera/lush-1.json",# 'tusun': "__asset__/trajs/camera/tusun-1.json",# 'painting': "__asset__/trajs/camera/painting-1.json",# }POINTS = { 'turtle': "__asset__/trajs/object/turtle-1.json", 'rose': "__asset__/trajs/object/rose-1.json", 'jellyfish': "__asset__/trajs/object/jellyfish-1.json", 'lush': "__asset__/trajs/camera/lush-1.json", 'tusun': "__asset__/trajs/camera/tusun-1.json", 'painting': "__asset__/trajs/camera/painting-1.json",}
# IMAGE_PATH = {# 'turtle': "__asset__/images/object/turtle-1.jpg",# 'rose': "__asset__/images/object/rose-1.jpg",# 'jellyfish': "__asset__/images/object/jellyfish-1.jpg",# 'lush': "__asset__/images/camera/lush-1.jpg",# 'tusun': "__asset__/images/camera/tusun-1.jpg",# 'painting': "__asset__/images/camera/painting-1.jpg",# }IMAGE_PATH = { 'turtle': "__asset__/images/object/turtle-1.jpg", 'rose': "__asset__/images/object/rose-1.jpg", 'jellyfish': "__asset__/images/object/jellyfish-1.jpg", 'lush': "__asset__/images/camera/lush-1.jpg", 'tusun': "__asset__/images/camera/tusun-1.jpg", 'painting': "__asset__/images/camera/painting-1.jpg",}
81 unmodified lines
self.blur_kernel = blur_kernel
@spaces.GPU(duration=20) @spaces.GPU(duration=180) def run(self, first_frame_path, tracking_points, prompt, drag_mode, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, personalized, examples_type): print("Run!") # if examples_type != "": # ### for adapting high version gradio # tracking_points = gr.State([]) # first_frame_path = IMAGE_PATH[examples_type] # points = json.load(open(POINTS[examples_type])) # tracking_points.value.extend(points) # print("example first_frame_path", first_frame_path) # print("example tracking_points", tracking_points.value) if examples_type != "": ### for adapting high version gradio tracking_points = gr.State([]) first_frame_path = IMAGE_PATH[examples_type] points = json.load(open(POINTS[examples_type])) tracking_points.value.extend(points) print("example first_frame_path", first_frame_path) print("example tracking_points", tracking_points.value) original_width, original_height=384, 256 if isinstance(tracking_points, list):3 unmodified lines print("input_all_points", input_all_points) resized_all_points = [tuple([tuple([float(e1[0]*self.width/original_width), float(e1[1]*self.height/original_height)]) for e1 in e]) for e in input_all_points] print("first_frame_path", first_frame_path)
dir, base, ext = split_filename(first_frame_path) id = base.split('_')[-1] 240 unmodified lines width=384, model_length=16 ) first_frame_path_var = gr.State() first_frame_path_var = gr.State(value=None) tracking_points_var = gr.State([])
with gr.Row():74 unmodified lines example = gr.Examples( label="Input Example", examples=image_examples, inputs=[input_image, prompt, drag_mode, seed, personalized, first_frame_path_var, tracking_points_var], inputs=[input_image, prompt, drag_mode, seed, personalized, examples_type], examples_per_page=10, cache_examples=False, )149 unmodified lines15015115215315315415515615615715815916016116215715815916016116216316416416516616716816917016516616716816917017117217317317417517617717817917417517617717817918018118118218318418518618718218318418518618718818918919019119219319419519019119219319419519619719819919920020120220320420520620020120220320420520620720820820921021121221321421520921021121221321421521621721821981 unmodified lines3013023033033043053063063073083093103113123133073083093103113123133143153163173 unmodified lines321322323323324325326327240 unmodified lines56856957057057157257357474 unmodified lines649650651651652653654655149 unmodified lines "object", 11318446767408804497, "", "turtle" "__asset__/images/object/turtle-1.jpg", json.load(open("__asset__/trajs/object/turtle-1.json")) ], ["__asset__/images/object/rose-1.jpg", "a red rose engulfed in flames.", "object", 6854275249656120509, "", "rose", ], # ["__asset__/images/object/rose-1.jpg", # "a red rose engulfed in flames.", # "object", # 6854275249656120509, # "", # "rose", # ], ["__asset__/images/object/jellyfish-1.jpg", "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.", "object", 17966188172968903484, "HelloObject", "jellyfish" ], # ["__asset__/images/object/jellyfish-1.jpg", # "intricate detailing,photorealism,hyperrealistic, glowing jellyfish mushroom, flying, starry sky, bokeh, golden ratio composition.", # "object", # 17966188172968903484, # "HelloObject", # "jellyfish" # ], ["__asset__/images/camera/lush-1.jpg", "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.", "camera", 7970487946960948963, "HelloObject", "lush", ], # ["__asset__/images/camera/lush-1.jpg", # "detailed craftsmanship, photorealism, hyperrealistic, roaring waterfall, misty spray, lush greenery, vibrant rainbow, golden ratio composition.", # "camera", # 7970487946960948963, # "HelloObject", # "lush", # ], ["__asset__/images/camera/tusun-1.jpg", "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.", "camera", 996953226890228361, "TUSUN", "tusun", ], # ["__asset__/images/camera/tusun-1.jpg", # "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.", # "camera", # 996953226890228361, # "TUSUN", # "tusun", # ], ["__asset__/images/camera/painting-1.jpg", "A oil painting.", "camera", 16867854766769816385, "", "painting" ], # ["__asset__/images/camera/painting-1.jpg", # "A oil painting.", # "camera", # 16867854766769816385, # "", # "painting" # ],]
POINTS = { 'turtle': "__asset__/trajs/object/turtle-1.json", 'rose': "__asset__/trajs/object/rose-1.json", 'jellyfish': "__asset__/trajs/object/jellyfish-1.json", 'lush': "__asset__/trajs/camera/lush-1.json", 'tusun': "__asset__/trajs/camera/tusun-1.json", 'painting': "__asset__/trajs/camera/painting-1.json",}# POINTS = {# 'turtle': "__asset__/trajs/object/turtle-1.json",# 'rose': "__asset__/trajs/object/rose-1.json",# 'jellyfish': "__asset__/trajs/object/jellyfish-1.json",# 'lush': "__asset__/trajs/camera/lush-1.json",# 'tusun': "__asset__/trajs/camera/tusun-1.json",# 'painting': "__asset__/trajs/camera/painting-1.json",# }
IMAGE_PATH = { 'turtle': "__asset__/images/object/turtle-1.jpg", 'rose': "__asset__/images/object/rose-1.jpg", 'jellyfish': "__asset__/images/object/jellyfish-1.jpg", 'lush': "__asset__/images/camera/lush-1.jpg", 'tusun': "__asset__/images/camera/tusun-1.jpg", 'painting': "__asset__/images/camera/painting-1.jpg",}# IMAGE_PATH = {# 'turtle': "__asset__/images/object/turtle-1.jpg",# 'rose': "__asset__/images/object/rose-1.jpg",# 'jellyfish': "__asset__/images/object/jellyfish-1.jpg",# 'lush': "__asset__/images/camera/lush-1.jpg",# 'tusun': "__asset__/images/camera/tusun-1.jpg",# 'painting': "__asset__/images/camera/painting-1.jpg",# }
81 unmodified lines
self.blur_kernel = blur_kernel
@spaces.GPU(duration=180) @spaces.GPU(duration=20) def run(self, first_frame_path, tracking_points, prompt, drag_mode, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, personalized, examples_type): print("Run!") if examples_type != "": ### for adapting high version gradio tracking_points = gr.State([]) first_frame_path = IMAGE_PATH[examples_type] points = json.load(open(POINTS[examples_type])) tracking_points.value.extend(points) print("example first_frame_path", first_frame_path) print("example tracking_points", tracking_points.value) # if examples_type != "": # ### for adapting high version gradio # tracking_points = gr.State([]) # first_frame_path = IMAGE_PATH[examples_type] # points = json.load(open(POINTS[examples_type])) # tracking_points.value.extend(points) # print("example first_frame_path", first_frame_path) # print("example tracking_points", tracking_points.value) original_width, original_height=384, 256 if isinstance(tracking_points, list):3 unmodified lines print("input_all_points", input_all_points) resized_all_points = [tuple([tuple([float(e1[0]*self.width/original_width), float(e1[1]*self.height/original_height)]) for e1 in e]) for e in input_all_points]
print("first_frame_path", first_frame_path) dir, base, ext = split_filename(first_frame_path) id = base.split('_')[-1] 240 unmodified lines width=384, model_length=16 ) first_frame_path_var = gr.State(value=None) first_frame_path_var = gr.State() tracking_points_var = gr.State([])
with gr.Row():74 unmodified lines example = gr.Examples( label="Input Example", examples=image_examples, inputs=[input_image, prompt, drag_mode, seed, personalized, examples_type], inputs=[input_image, prompt, drag_mode, seed, personalized, first_frame_path_var, tracking_points_var], examples_per_page=10, cache_examples=False, )app-23.py → app-12.pyRenamed+64-65
app.py+65-64