MohamedRashad commited on
Commit
5ee125e
·
1 Parent(s): 1273148

Refactor FluxPipeline and AutoencoderKL initialization to remove device assignment

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -20,10 +20,8 @@ from live_preview_helpers import flux_pipe_call_that_returns_an_iterable_of_imag
20
 
21
  llm_client = Client("Qwen/Qwen2.5-72B-Instruct")
22
 
23
- device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
24
-
25
- pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to(device)
26
- good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16).to(device)
27
  pipe.flux_pipe_call_that_returns_an_iterable_of_images = flux_pipe_call_that_returns_an_iterable_of_images.__get__(pipe)
28
 
29
  def generate_t2i_prompt(item_name):
 
20
 
21
  llm_client = Client("Qwen/Qwen2.5-72B-Instruct")
22
 
23
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
24
+ good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16)
 
 
25
  pipe.flux_pipe_call_that_returns_an_iterable_of_images = flux_pipe_call_that_returns_an_iterable_of_images.__get__(pipe)
26
 
27
  def generate_t2i_prompt(item_name):