jokerbit commited on
Commit
e13e27c
·
verified ·
1 Parent(s): f565b85

transformer only

Browse files
Files changed (1) hide show
  1. src/pipeline.py +3 -2
src/pipeline.py CHANGED
@@ -13,6 +13,7 @@ from transformers import T5EncoderModel, CLIPTextModel
13
 
14
 
15
  Pipeline: TypeAlias = FluxPipeline
 
16
  torch.backends.cudnn.benchmark = True
17
 
18
  CHECKPOINT = "jokerbit/flux.1-schnell-Robert-int8wo"
@@ -38,11 +39,11 @@ def load_pipeline() -> Pipeline:
38
  torch_dtype=torch.bfloat16,
39
  )
40
 
41
- pipeline.to(memory_format=torch.channels_last)
42
  pipeline.to("cuda")
43
  for _ in range(4):
44
  pipeline("cat", num_inference_steps=4)
45
-
46
  return pipeline
47
 
48
  @torch.inference_mode()
 
13
 
14
 
15
  Pipeline: TypeAlias = FluxPipeline
16
+ os.environ['PYTORCH_CUDA_ALLOC_CONF']="expandable_segments:True"
17
  torch.backends.cudnn.benchmark = True
18
 
19
  CHECKPOINT = "jokerbit/flux.1-schnell-Robert-int8wo"
 
39
  torch_dtype=torch.bfloat16,
40
  )
41
 
42
+ pipeline.transformer.to(memory_format=torch.channels_last)
43
  pipeline.to("cuda")
44
  for _ in range(4):
45
  pipeline("cat", num_inference_steps=4)
46
+ torch.cuda.empty_cache()
47
  return pipeline
48
 
49
  @torch.inference_mode()