Yaron Koresh commited on
Commit
edf8bb9
·
verified ·
1 Parent(s): ec6c7be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -10,7 +10,7 @@ import numpy as np
10
  from lxml.html import fromstring
11
  from pathos.threading import ThreadPool as Pool
12
  from diffusers import DiffusionPipeline
13
- #from diffusers.pipelines.stable_diffusion.pipeline_flax_stable_diffusion import FlaxStableDiffusionPipeline as FluxPipeline
14
  #from diffusers.utils import export_to_gif
15
  #from huggingface_hub import hf_hub_download
16
  #from safetensors.torch import load_file
@@ -18,6 +18,7 @@ from diffusers import DiffusionPipeline
18
  device = "cuda" if torch.cuda.is_available() else "cpu"
19
  dtype = torch.bfloat16
20
  pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
 
21
 
22
  def translate(text,lang):
23
 
@@ -82,7 +83,7 @@ def Piper(_do,_dont):
82
  try:
83
  neg = pipe.tokenizer(_dont)['input_ids']
84
  print(neg)
85
- retu = pipe(
86
  _do,
87
  neg_prompt_ids=neg,
88
  height=512,
 
10
  from lxml.html import fromstring
11
  from pathos.threading import ThreadPool as Pool
12
  from diffusers import DiffusionPipeline
13
+ from diffusers.pipelines.stable_diffusion.pipeline_flax_stable_diffusion import FlaxStableDiffusionPipeline as FluxPipeline
14
  #from diffusers.utils import export_to_gif
15
  #from huggingface_hub import hf_hub_download
16
  #from safetensors.torch import load_file
 
18
  device = "cuda" if torch.cuda.is_available() else "cpu"
19
  dtype = torch.bfloat16
20
  pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
21
+ pipe_flx = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
22
 
23
  def translate(text,lang):
24
 
 
83
  try:
84
  neg = pipe.tokenizer(_dont)['input_ids']
85
  print(neg)
86
+ retu = pipe_flx(
87
  _do,
88
  neg_prompt_ids=neg,
89
  height=512,