KevinNg99 commited on
Commit
849e547
·
1 Parent(s): 28ff5bc

share text encoder

Browse files
app.py CHANGED
@@ -173,8 +173,9 @@ def load_pipeline(use_distilled: bool = False, device: str = "cuda"):
173
  enable_refiner_offloading=True
174
  )
175
  pipeline.to('cpu')
176
- # refiner_pipeline = pipeline.refiner_pipeline
177
- # refiner_pipeline.to('cpu')
 
178
  reprompt_model = pipeline.reprompt_model
179
 
180
  print("✓ Pipeline loaded successfully")
 
173
  enable_refiner_offloading=True
174
  )
175
  pipeline.to('cpu')
176
+ refiner_pipeline = pipeline.refiner_pipeline
177
+ refiner_pipeline.text_encoder = pipeline.text_encoder
178
+ refiner_pipeline.to('cpu')
179
  reprompt_model = pipeline.reprompt_model
180
 
181
  print("✓ Pipeline loaded successfully")
hyimage/diffusion/pipelines/hunyuanimage_pipeline.py CHANGED
@@ -816,8 +816,8 @@ class HunyuanImagePipeline:
816
  self.device = device
817
  if self.dit is not None:
818
  self.dit = self.dit.to(device, non_blocking=True)
819
- if self.text_encoder is not None:
820
- self.text_encoder = self.text_encoder.to(device, non_blocking=True)
821
  if self.vae is not None:
822
  self.vae = self.vae.to(device, non_blocking=True)
823
  return self
 
816
  self.device = device
817
  if self.dit is not None:
818
  self.dit = self.dit.to(device, non_blocking=True)
819
+ # if self.text_encoder is not None:
820
+ # self.text_encoder = self.text_encoder.to(device, non_blocking=True)
821
  if self.vae is not None:
822
  self.vae = self.vae.to(device, non_blocking=True)
823
  return self