saicharan1234 commited on
Commit
fd55bc4
·
verified ·
1 Parent(s): d3e887f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +14 -3
main.py CHANGED
@@ -1,7 +1,7 @@
1
  import torch
2
  import os
3
  import uuid
4
- from diffusers import AnimateDiffPipeline, MotionAdapter, EulerDiscreteScheduler
5
  from diffusers.utils import export_to_video
6
  from huggingface_hub import hf_hub_download
7
  from safetensors.torch import load_file
@@ -18,6 +18,17 @@ bases = {
18
  "3d": "Lykon/DreamShaper",
19
  "Anime": "Yntec/mistoonAnime2"
20
  }
 
 
 
 
 
 
 
 
 
 
 
21
  step_loaded = None
22
  base_loaded = "Realistic"
23
  motion_loaded = None
@@ -39,7 +50,7 @@ def generate_image(prompt, base="Realistic", motion="", step=8):
39
  global step_loaded
40
  global base_loaded
41
  global motion_loaded
42
- print(prompt, base, step)
43
 
44
  if step_loaded != step:
45
  repo = "ByteDance/AnimateDiff-Lightning"
@@ -82,4 +93,4 @@ async def generate_video(
82
  # Run the app
83
  if __name__ == "__main__":
84
  import uvicorn
85
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
1
  import torch
2
  import os
3
  import uuid
4
+ from diffusers import AnimateDiffPipeline, EulerDiscreteScheduler
5
  from diffusers.utils import export_to_video
6
  from huggingface_hub import hf_hub_download
7
  from safetensors.torch import load_file
 
18
  "3d": "Lykon/DreamShaper",
19
  "Anime": "Yntec/mistoonAnime2"
20
  }
21
+ motion_choices = {
22
+ "": "Default",
23
+ "guoyww/animatediff-motion-lora-zoom-in": "Zoom in",
24
+ "guoyww/animatediff-motion-lora-zoom-out": "Zoom out",
25
+ "guoyww/animatediff-motion-lora-tilt-up": "Tilt up",
26
+ "guoyww/animatediff-motion-lora-tilt-down": "Tilt down",
27
+ "guoyww/animatediff-motion-lora-pan-left": "Pan left",
28
+ "guoyww/animatediff-motion-lora-pan-right": "Pan right",
29
+ "guoyww/animatediff-motion-lora-rolling-anticlockwise": "Roll left",
30
+ "guoyww/animatediff-motion-lora-rolling-clockwise": "Roll right"
31
+ }
32
  step_loaded = None
33
  base_loaded = "Realistic"
34
  motion_loaded = None
 
50
  global step_loaded
51
  global base_loaded
52
  global motion_loaded
53
+ print(prompt, base, step, motion)
54
 
55
  if step_loaded != step:
56
  repo = "ByteDance/AnimateDiff-Lightning"
 
93
  # Run the app
94
  if __name__ == "__main__":
95
  import uvicorn
96
+ uvicorn.run(app, host="0.0.0.0", port=8000)