yaron123 commited on
Commit
fb4e2c7
·
1 Parent(s): da39ccc
Files changed (4) hide show
  1. app.py +10 -9
  2. dist.bat +26 -0
  3. dist.sh +17 -0
  4. requirements.txt +2 -1
app.py CHANGED
@@ -17,6 +17,7 @@ from functools import partial
17
 
18
  # external
19
 
 
20
  import torch
21
  import gradio as gr
22
  from numpy import asarray as array
@@ -56,11 +57,11 @@ additional_image = None
56
  # precision data
57
 
58
  seq=512
59
- fps=20
60
- width=1920
61
- height=1080
62
  image_steps=8
63
- video_steps=20
64
  accu=4.5
65
 
66
  # ui data
@@ -109,7 +110,7 @@ function custom(){
109
  e.target.removeAttribute("last_value");
110
  }
111
  });
112
- \
113
  document.querySelector("div#prompt2 input").addEventListener("keydown",function(e){
114
  e.target.setAttribute("last_value",e.target.value);
115
  });
@@ -186,8 +187,8 @@ def generate_random_string(length):
186
  characters = str(ascii_letters + digits)
187
  return ''.join(random.choice(characters) for _ in range(length))
188
 
 
189
  def pipe_generate(img,p1,p2,time,title):
190
- global last_motion
191
  global pipe
192
 
193
  if img is None:
@@ -272,7 +273,7 @@ def ui():
272
  global result
273
  with gr.Blocks(theme=gr.themes.Citrus(),css=css,js=js) as demo:
274
  gr.Markdown(f"""
275
- # MP4/PNG Creator
276
  """)
277
  with gr.Row():
278
  title = gr.Textbox(
@@ -296,9 +297,9 @@ def ui():
296
  with gr.Row():
297
  time = gr.Slider(
298
  minimum=0.0,
299
- maximum=600.0,
300
  value=0.0,
301
- step=5.0,
302
  label="Duration (0s = PNG)"
303
  )
304
  with gr.Row(elem_id="col-container"):
 
17
 
18
  # external
19
 
20
+ import spaces
21
  import torch
22
  import gradio as gr
23
  from numpy import asarray as array
 
57
  # precision data
58
 
59
  seq=512
60
+ fps=18
61
+ width=768
62
+ height=768
63
  image_steps=8
64
+ video_steps=15
65
  accu=4.5
66
 
67
  # ui data
 
110
  e.target.removeAttribute("last_value");
111
  }
112
  });
113
+
114
  document.querySelector("div#prompt2 input").addEventListener("keydown",function(e){
115
  e.target.setAttribute("last_value",e.target.value);
116
  });
 
187
  characters = str(ascii_letters + digits)
188
  return ''.join(random.choice(characters) for _ in range(length))
189
 
190
+ spaces.GPU(duration=40)
191
  def pipe_generate(img,p1,p2,time,title):
 
192
  global pipe
193
 
194
  if img is None:
 
273
  global result
274
  with gr.Blocks(theme=gr.themes.Citrus(),css=css,js=js) as demo:
275
  gr.Markdown(f"""
276
+ # Photo Motion - PNG/MP4 Generator
277
  """)
278
  with gr.Row():
279
  title = gr.Textbox(
 
297
  with gr.Row():
298
  time = gr.Slider(
299
  minimum=0.0,
300
+ maximum=3.0,
301
  value=0.0,
302
+ step=1.0,
303
  label="Duration (0s = PNG)"
304
  )
305
  with gr.Row(elem_id="col-container"):
dist.bat ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ cd "%~dp0"
3
+
4
+ call git lfs install
5
+ call git fetch
6
+ call git checkout
7
+ call git add --all .
8
+ call git commit -m "commit"
9
+ ( call git rebase ) || (
10
+ call :conflicts
11
+ )
12
+ ( call git push ) && (
13
+ echo Finished.
14
+ pause
15
+ exit /b 0
16
+ ) || (
17
+ echo Error: Failed to push!
18
+ pause
19
+ exit /b 1
20
+ )
21
+
22
+ :conflicts
23
+ echo Please fix the conflicts, then, press any key to continue
24
+ pause
25
+ call git add --all .
26
+ call git rebase --continue || call :conflicts
dist.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ conflicts () {
4
+ read -n 1 -p "Please fix the conflicts, then, press any key to continue" tmp
5
+ git add --all .
6
+ git rebase --continue || conflicts
7
+ }
8
+
9
+ git lfs install
10
+ git fetch
11
+ git checkout
12
+ git add --all .
13
+ git commit -m "commit"
14
+ ( git rebase ) || (
15
+ conflicts
16
+ )
17
+ ( git push ) && ( read -n 1 -p "Finished." tmp ) || ( read -n 1 -p "Error: Failed to push!" tmp )
requirements.txt CHANGED
@@ -13,4 +13,5 @@ diffusers
13
  transformers==4.48.0
14
  sentencepiece
15
  imageio-ffmpeg
16
- imageio
 
 
13
  transformers==4.48.0
14
  sentencepiece
15
  imageio-ffmpeg
16
+ imageio
17
+ spaces