Spaces:
Sleeping
Sleeping
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
|
13 |
from diffusers.utils import export_to_gif
|
14 |
from huggingface_hub import hf_hub_download
|
15 |
from safetensors.torch import load_file
|
@@ -25,7 +25,7 @@ base = "black-forest-labs/FLUX.1-dev"
|
|
25 |
|
26 |
adapter = MotionAdapter().to(device, dtype)
|
27 |
adapter.load_state_dict(load_file(hf_hub_download(repo ,ckpt), device=device))
|
28 |
-
pipe =
|
29 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
|
30 |
|
31 |
def translate(text,lang):
|
|
|
9 |
import numpy as np
|
10 |
from lxml.html import fromstring
|
11 |
from pathos.threading import ThreadPool as Pool
|
12 |
+
from diffusers import FluxPipeline, MotionAdapter, EulerDiscreteScheduler
|
13 |
from diffusers.utils import export_to_gif
|
14 |
from huggingface_hub import hf_hub_download
|
15 |
from safetensors.torch import load_file
|
|
|
25 |
|
26 |
adapter = MotionAdapter().to(device, dtype)
|
27 |
adapter.load_state_dict(load_file(hf_hub_download(repo ,ckpt), device=device))
|
28 |
+
pipe = FluxPipeline.from_pretrained(base, motion_adapter=adapter, torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
|
29 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
|
30 |
|
31 |
def translate(text,lang):
|