mirror of https://github.com/skygpu/skynet.git
				
				
				
			Only check if should cancel inference every two steps, also pipe to cuda if cpu offloading is off
							parent
							
								
									9fa5a01c34
								
							
						
					
					
						commit
						93203ab533
					
				| 
						 | 
					@ -151,7 +151,7 @@ class SkynetMM:
 | 
				
			||||||
                        num_inference_steps=step,
 | 
					                        num_inference_steps=step,
 | 
				
			||||||
                        generator=seed,
 | 
					                        generator=seed,
 | 
				
			||||||
                        callback=callback_fn,
 | 
					                        callback=callback_fn,
 | 
				
			||||||
                        callback_steps=1,
 | 
					                        callback_steps=2,
 | 
				
			||||||
                        **extra_params
 | 
					                        **extra_params
 | 
				
			||||||
                    ).images[0]
 | 
					                    ).images[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -113,6 +113,8 @@ def pipeline_for(model: str, mem_fraction: float = 1.0, image=False) -> Diffusio
 | 
				
			||||||
    pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(
 | 
					    pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(
 | 
				
			||||||
        pipe.scheduler.config)
 | 
					        pipe.scheduler.config)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pipe.enable_xformers_memory_efficient_attention()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if over_mem:
 | 
					    if over_mem:
 | 
				
			||||||
        if not image:
 | 
					        if not image:
 | 
				
			||||||
            pipe.enable_vae_slicing()
 | 
					            pipe.enable_vae_slicing()
 | 
				
			||||||
| 
						 | 
					@ -120,7 +122,8 @@ def pipeline_for(model: str, mem_fraction: float = 1.0, image=False) -> Diffusio
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        pipe.enable_model_cpu_offload()
 | 
					        pipe.enable_model_cpu_offload()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pipe.enable_xformers_memory_efficient_attention()
 | 
					    else:
 | 
				
			||||||
 | 
					        pipe = pipe.to('cuda')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return pipe
 | 
					    return pipe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue