HaileyStorm commited on
Commit
b56725c
·
verified ·
1 Parent(s): 29003e7

Update infer.py

Browse files
Files changed (1) hide show
  1. infer.py +2 -1
infer.py CHANGED
@@ -39,7 +39,8 @@ print("Creating pipeline...")
39
  pipeline = FluxPipeline.from_pretrained(
40
  "black-forest-labs/FLUX.1-dev", transformer=transformer, torch_dtype=torch.bfloat16
41
  , use_safetensors=True).to(DEVICE)
42
- pipeline.enable_sequential_cpu_offload()
 
43
  print("Generating image...")
44
  # Params:
45
  # prompt – The prompt or prompts to guide the image generation. If not defined, one has to pass prompt_embeds. instead.
 
39
  pipeline = FluxPipeline.from_pretrained(
40
  "black-forest-labs/FLUX.1-dev", transformer=transformer, torch_dtype=torch.bfloat16
41
  , use_safetensors=True).to(DEVICE)
42
+ if USE_CPU_OFFLOAD:
43
+ pipeline.enable_sequential_cpu_offload()
44
  print("Generating image...")
45
  # Params:
46
  # prompt – The prompt or prompts to guide the image generation. If not defined, one has to pass prompt_embeds. instead.