Update infer.py
Browse files
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 |
-
|
|
|
|
| 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.
|