Update src/pipeline.py
Browse files- src/pipeline.py +2 -2
src/pipeline.py
CHANGED
|
@@ -135,7 +135,7 @@ def load_pipeline(pipeline=None) -> StableDiffusionXLPipeline:
|
|
| 135 |
# "unelectrical, overdearness, reinsurer",
|
| 136 |
]
|
| 137 |
|
| 138 |
-
for name, param in
|
| 139 |
if param.requires_grad and 'scaling_factor' not in name:
|
| 140 |
param.requires_grad = False
|
| 141 |
if param.requires_grad:
|
|
@@ -190,7 +190,7 @@ def load_pipeline(pipeline=None) -> StableDiffusionXLPipeline:
|
|
| 190 |
}, 'optimized_params.pth')
|
| 191 |
|
| 192 |
# Use the optimized parameters in the pipeline
|
| 193 |
-
|
| 194 |
exit()
|
| 195 |
|
| 196 |
def infer(request: TextToImageRequest, pipeline: StableDiffusionXLPipeline) -> Image:
|
|
|
|
| 135 |
# "unelectrical, overdearness, reinsurer",
|
| 136 |
]
|
| 137 |
|
| 138 |
+
for name, param in pipeline.named_parameters():
|
| 139 |
if param.requires_grad and 'scaling_factor' not in name:
|
| 140 |
param.requires_grad = False
|
| 141 |
if param.requires_grad:
|
|
|
|
| 190 |
}, 'optimized_params.pth')
|
| 191 |
|
| 192 |
# Use the optimized parameters in the pipeline
|
| 193 |
+
pipeline.vae.config.scaling_factor = scaling_factor.item()
|
| 194 |
exit()
|
| 195 |
|
| 196 |
def infer(request: TextToImageRequest, pipeline: StableDiffusionXLPipeline) -> Image:
|