SkalskiP commited on
Commit
f0e8d1f
1 Parent(s): ea9aef9

try to make it work with ZERO

Browse files
Files changed (2) hide show
  1. app.py +3 -6
  2. requirements.txt +1 -1
app.py CHANGED
@@ -10,16 +10,13 @@ creating this amazing model, and a big thanks to [Gothos](https://github.com/Got
10
  for taking it to the next level by enabling inpainting with the FLUX.
11
  """
12
 
13
- DEVICE = torch.device("cuda")
14
- # DEVICE = torch.device("cpu")
15
 
16
  pipe = FluxInpaintPipeline.from_pretrained(
17
- "black-forest-labs/FLUX.1-schnell",
18
- torch_dtype=torch.bfloat16)
19
- pipe.to(DEVICE)
20
 
21
 
22
- @spaces.GPU()
23
  def process(input_image_editor, input_text, progress=gr.Progress(track_tqdm=True)):
24
  if not input_text:
25
  gr.Info("Please enter a text prompt.")
 
10
  for taking it to the next level by enabling inpainting with the FLUX.
11
  """
12
 
13
+ DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
 
14
 
15
  pipe = FluxInpaintPipeline.from_pretrained(
16
+ "black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16).to(DEVICE)
 
 
17
 
18
 
19
+ @spaces.GPU(duration=200)
20
  def process(input_image_editor, input_text, progress=gr.Progress(track_tqdm=True)):
21
  if not input_text:
22
  gr.Info("Please enter a text prompt.")
requirements.txt CHANGED
@@ -1,6 +1,6 @@
1
  gradio
2
  spaces
3
  accelerate
4
- transformers
5
  sentencepiece
6
  git+https://github.com/Gothos/diffusers.git@flux-inpaint
 
1
  gradio
2
  spaces
3
  accelerate
4
+ transformers==4.42.4
5
  sentencepiece
6
  git+https://github.com/Gothos/diffusers.git@flux-inpaint