Yaron Koresh commited on
Commit
42c98a9
·
verified ·
1 Parent(s): 5959cb1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -35,20 +35,21 @@ formatter = logging.Formatter('\n >>> [%(levelname)s] %(asctime)s %(name)s: %(me
35
  handler.setFormatter(formatter)
36
  root.addHandler(handler)
37
  handler2 = logging.StreamHandler(sys.stderr)
 
38
  formatter = logging.Formatter('\n >>> [%(levelname)s] %(asctime)s %(name)s: %(message)s\n')
39
  handler2.setFormatter(formatter)
40
  root.addHandler(handler2)
41
 
42
  last_motion=None
43
- fps=15
44
- time=2
45
- width=896
46
- height=896
47
  device = "cuda"
48
  dtype = torch.float16
49
  result=[]
50
- step = 25
51
- accu=7.5
52
  #repo = "ByteDance/AnimateDiff-Lightning"
53
  #ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
54
  #base = "emilianJR/epiCRealism"
@@ -189,7 +190,7 @@ def infer(pm):
189
 
190
  _do = ['beautiful', 'playful', 'photographed', 'realistic', 'dynamic poze', 'deep field', 'reasonable coloring', 'rough texture', 'best quality', 'focused']
191
  if p1 != "":
192
- _do.append(f'dynamic {p1} movement')
193
  posi = " ".join(_do)
194
 
195
  if pm["i"] == None:
@@ -228,7 +229,7 @@ pipe.scheduler = DDIMScheduler(
228
  #pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device), strict=False)
229
  pipe.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter_sd15.bin")
230
  pipe.enable_vae_slicing()
231
- pipe.enable_free_init(method="butterworth", use_fast_sampling=True)
232
 
233
  mp.set_start_method("spawn", force=True)
234
 
@@ -242,24 +243,24 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
242
  with gr.Row():
243
  prompt = gr.Textbox(
244
  elem_id="prompt",
245
- placeholder="CONTENT MOVEMENT",
246
  container=False,
247
  max_lines=1
248
  )
249
  with gr.Row():
250
  prompt2 = gr.Textbox(
251
  elem_id="prompt2",
252
- placeholder="CONTENT EXCLUSION",
253
  container=False,
254
  max_lines=1
255
  )
256
  with gr.Row():
257
  motion = gr.Dropdown(
258
- label='CAMERA MOVEMENT',
259
  show_label=True,
260
  container=True,
261
  choices=[
262
- ("(None)", ""),
263
  ("Zoom in", "guoyww/animatediff-motion-lora-zoom-in"),
264
  ("Zoom out", "guoyww/animatediff-motion-lora-zoom-out"),
265
  ("Tilt up", "guoyww/animatediff-motion-lora-tilt-up"),
 
35
  handler.setFormatter(formatter)
36
  root.addHandler(handler)
37
  handler2 = logging.StreamHandler(sys.stderr)
38
+ handler2.setLevel(logging.DEBUG)
39
  formatter = logging.Formatter('\n >>> [%(levelname)s] %(asctime)s %(name)s: %(message)s\n')
40
  handler2.setFormatter(formatter)
41
  root.addHandler(handler2)
42
 
43
  last_motion=None
44
+ fps=10
45
+ time=1
46
+ width=448
47
+ height=448
48
  device = "cuda"
49
  dtype = torch.float16
50
  result=[]
51
+ step = 15
52
+ accu=2
53
  #repo = "ByteDance/AnimateDiff-Lightning"
54
  #ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
55
  #base = "emilianJR/epiCRealism"
 
190
 
191
  _do = ['beautiful', 'playful', 'photographed', 'realistic', 'dynamic poze', 'deep field', 'reasonable coloring', 'rough texture', 'best quality', 'focused']
192
  if p1 != "":
193
+ _do.append(f'{p1}')
194
  posi = " ".join(_do)
195
 
196
  if pm["i"] == None:
 
229
  #pipe.unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device=device), strict=False)
230
  pipe.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter_sd15.bin")
231
  pipe.enable_vae_slicing()
232
+ pipe.enable_free_init(method="butterworth", use_fast_sampling=False)
233
 
234
  mp.set_start_method("spawn", force=True)
235
 
 
243
  with gr.Row():
244
  prompt = gr.Textbox(
245
  elem_id="prompt",
246
+ placeholder="INCLUDE",
247
  container=False,
248
  max_lines=1
249
  )
250
  with gr.Row():
251
  prompt2 = gr.Textbox(
252
  elem_id="prompt2",
253
+ placeholder="EXCLUDE",
254
  container=False,
255
  max_lines=1
256
  )
257
  with gr.Row():
258
  motion = gr.Dropdown(
259
+ label='CAMERA',
260
  show_label=True,
261
  container=True,
262
  choices=[
263
+ ("(No Effect)", ""),
264
  ("Zoom in", "guoyww/animatediff-motion-lora-zoom-in"),
265
  ("Zoom out", "guoyww/animatediff-motion-lora-zoom-out"),
266
  ("Tilt up", "guoyww/animatediff-motion-lora-tilt-up"),