Update src/pipeline.py
Browse files- src/pipeline.py +7 -4
src/pipeline.py
CHANGED
|
@@ -39,14 +39,17 @@ def load_pipeline(pipeline=None) -> StableDiffusionXLPipeline:
|
|
| 39 |
|
| 40 |
pipeline.scheduler = SchedulerWrapper(DDIMScheduler.from_config(pipeline.scheduler.config))
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
|
|
|
| 44 |
|
| 45 |
-
for _ in range(
|
| 46 |
deepcache_output = pipeline(prompt="telestereography, unstrengthen, preadministrator, copatroness, hyperpersonal, paramountness, paranoid, guaniferous", output_type="pil", num_inference_steps=20)
|
| 47 |
pipeline.scheduler.prepare_loss()
|
| 48 |
-
for _ in range(
|
| 49 |
pipeline(prompt="telestereography, unstrengthen, preadministrator, copatroness, hyperpersonal, paramountness, paranoid, guaniferous", output_type="pil", num_inference_steps=20)
|
|
|
|
|
|
|
| 50 |
return pipeline
|
| 51 |
|
| 52 |
def infer(request: TextToImageRequest, pipeline: StableDiffusionXLPipeline) -> Image:
|
|
|
|
| 39 |
|
| 40 |
pipeline.scheduler = SchedulerWrapper(DDIMScheduler.from_config(pipeline.scheduler.config))
|
| 41 |
|
| 42 |
+
pipeline = compile_pipe(pipeline)
|
| 43 |
+
|
| 44 |
+
# load_pipe(pipeline, dir="/home/sandbox/.cache/huggingface/hub/models--RobertML--cached-pipe-02/snapshots/58d70deae87034cce351b780b48841f9746d4ad7")
|
| 45 |
|
| 46 |
+
for _ in range(2):
|
| 47 |
deepcache_output = pipeline(prompt="telestereography, unstrengthen, preadministrator, copatroness, hyperpersonal, paramountness, paranoid, guaniferous", output_type="pil", num_inference_steps=20)
|
| 48 |
pipeline.scheduler.prepare_loss()
|
| 49 |
+
for _ in range(4):
|
| 50 |
pipeline(prompt="telestereography, unstrengthen, preadministrator, copatroness, hyperpersonal, paramountness, paranoid, guaniferous", output_type="pil", num_inference_steps=20)
|
| 51 |
+
# save the compiled pipe
|
| 52 |
+
save_pipe(pipe, dir="/home/.cache/")
|
| 53 |
return pipeline
|
| 54 |
|
| 55 |
def infer(request: TextToImageRequest, pipeline: StableDiffusionXLPipeline) -> Image:
|