Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ import gradio as gr
|
|
9 |
import numpy as np
|
10 |
from lxml.html import fromstring
|
11 |
from pathos.threading import ThreadPool as Pool
|
12 |
-
from diffusers import MotionAdapter, EulerDiscreteScheduler
|
13 |
from diffusers.pipelines.flux import FluxPipeline
|
14 |
from diffusers.utils import export_to_gif
|
15 |
from huggingface_hub import hf_hub_download
|
@@ -26,7 +26,8 @@ base = "black-forest-labs/FLUX.1-dev"
|
|
26 |
|
27 |
adapter = MotionAdapter().to(device, dtype)
|
28 |
adapter.load_state_dict(load_file(hf_hub_download(repo ,ckpt), device=device))
|
29 |
-
pipe =
|
|
|
30 |
|
31 |
def translate(text,lang):
|
32 |
|
|
|
9 |
import numpy as np
|
10 |
from lxml.html import fromstring
|
11 |
from pathos.threading import ThreadPool as Pool
|
12 |
+
from diffusers import AnimateDiffPipeline, MotionAdapter, EulerDiscreteScheduler
|
13 |
from diffusers.pipelines.flux import FluxPipeline
|
14 |
from diffusers.utils import export_to_gif
|
15 |
from huggingface_hub import hf_hub_download
|
|
|
26 |
|
27 |
adapter = MotionAdapter().to(device, dtype)
|
28 |
adapter.load_state_dict(load_file(hf_hub_download(repo ,ckpt), device=device))
|
29 |
+
pipe = AnimateDiffPipeline.from_pretrained(base, motion_adapter=adapter, torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
|
30 |
+
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
|
31 |
|
32 |
def translate(text,lang):
|
33 |
|