MohamedRashad commited on
Commit
5ba7022
·
1 Parent(s): 9cb3d0f

Update Flux pipeline initialization to load on CPU and reflect device in log

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,9 +20,9 @@ from diffusers import FluxPipeline
20
  llm_client = Client("Qwen/Qwen2.5-72B-Instruct")
21
 
22
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23
- pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to(device)
24
- print(f"Flux pipeline loaded on {device}")
25
-
26
  def generate_t2i_prompt(item_name):
27
  llm_prompt_template = """You are tasked with creating a concise yet highly detailed description of an item to be used for generating an image in a game development pipeline. The image should show the **entire item** with no parts cropped or hidden. The background should always be plain and monocolor, with no focus on it.
28
 
 
20
  llm_client = Client("Qwen/Qwen2.5-72B-Instruct")
21
 
22
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
23
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to("cpu")
24
+ print(f"Flux pipeline loaded on {pipe.device}")
25
+
26
  def generate_t2i_prompt(item_name):
27
  llm_prompt_template = """You are tasked with creating a concise yet highly detailed description of an item to be used for generating an image in a game development pipeline. The image should show the **entire item** with no parts cropped or hidden. The background should always be plain and monocolor, with no focus on it.
28