@@ -202,7 +202,7 @@ def test_flux_the_last_ben(self):
202202 self .pipeline .load_lora_weights ("TheLastBen/Jon_Snow_Flux_LoRA" , weight_name = "jon_snow.safetensors" )
203203 self .pipeline .fuse_lora ()
204204 self .pipeline .unload_lora_weights ()
205- self .pipeline . enable_model_cpu_offload ( )
205+ self .pipeline = self . pipeline . to ( "cuda" )
206206
207207 prompt = "jon snow eating pizza with ketchup"
208208
@@ -225,7 +225,10 @@ def test_flux_kohya(self):
225225 self .pipeline .load_lora_weights ("Norod78/brain-slug-flux" )
226226 self .pipeline .fuse_lora ()
227227 self .pipeline .unload_lora_weights ()
228- self .pipeline .enable_model_cpu_offload ()
228+ # Instead of calling `enable_model_cpu_offload()`, we do a cuda placement here because the CI
229+ # run supports it. We have about 34GB RAM in the CI runner which kills the test when run with
230+ # `enable_model_cpu_offload()`.
231+ self .pipeline = self .pipeline .to ("cuda" )
229232
230233 prompt = "The cat with a brain slug earring"
231234 out = self .pipeline (
@@ -248,7 +251,7 @@ def test_flux_kohya_with_text_encoder(self):
248251 self .pipeline .load_lora_weights ("cocktailpeanut/optimus" , weight_name = "optimus.safetensors" )
249252 self .pipeline .fuse_lora ()
250253 self .pipeline .unload_lora_weights ()
251- self .pipeline . enable_model_cpu_offload ( )
254+ self .pipeline = self . pipeline . to ( "cuda" )
252255
253256 prompt = "optimus is cleaning the house with broomstick"
254257 out = self .pipeline (
@@ -271,7 +274,7 @@ def test_flux_xlabs(self):
271274 self .pipeline .load_lora_weights ("XLabs-AI/flux-lora-collection" , weight_name = "disney_lora.safetensors" )
272275 self .pipeline .fuse_lora ()
273276 self .pipeline .unload_lora_weights ()
274- self .pipeline . enable_model_cpu_offload ( )
277+ self .pipeline = self . pipeline . to ( "cuda" )
275278
276279 prompt = "A blue jay standing on a large basket of rainbow macarons, disney style"
277280
0 commit comments