Yaron Koresh commited on
Commit
096ee5a
·
verified ·
1 Parent(s): c2cc01f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -17,7 +17,7 @@ from diffusers.pipelines.flux import FluxPipeline
17
 
18
  device = "cuda" if torch.cuda.is_available() else "cpu"
19
  dtype = torch.bfloat16
20
- pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=dtype, token=os.getenv("hf_token")).to(device)
21
 
22
  def translate(text,lang):
23
 
@@ -77,16 +77,16 @@ def generate_random_string(length):
77
  characters = string.ascii_letters + string.digits
78
  return ''.join(random.choice(characters) for _ in range(length))
79
 
80
- @spaces.GPU(duration=45)
81
  def Piper(_do):
82
  try:
83
  retu = pipe(
84
  _do,
85
- height=480,
86
- width=480,
87
- num_inference_steps=50,
88
- max_sequence_length=512,
89
- guidance_scale=7
90
  )
91
  return retu
92
  except:
 
17
 
18
  device = "cuda" if torch.cuda.is_available() else "cpu"
19
  dtype = torch.bfloat16
20
+ pipe = FluxPipeline.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
 
 
77
  characters = string.ascii_letters + string.digits
78
  return ''.join(random.choice(characters) for _ in range(length))
79
 
80
+ @spaces.GPU(duration=50)
81
  def Piper(_do):
82
  try:
83
  retu = pipe(
84
  _do,
85
+ height=4096,
86
+ width=4096,
87
+ num_inference_steps=4,
88
+ max_sequence_length=256,
89
+ guidance_scale=2
90
  )
91
  return retu
92
  except: