Spaces:
Runtime error
Runtime error
move pipes explicitly to 'cpu' after using them
Browse files
app.py
CHANGED
@@ -120,6 +120,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
120 |
inversion_state = ImageEditorDemo.invert(pipe_inversion.to(device), input_image, description_prompt, config,
|
121 |
[rnri_iterations, rnri_alpha, rnri_lr], device)
|
122 |
if device == 'cuda':
|
|
|
123 |
torch.cuda.empty_cache()
|
124 |
# pipe_inversion = pipe_inversion.to('cpu')
|
125 |
print(f"#### 3 #### pipe_inversion.device: {pipe_inversion.device}")
|
@@ -158,6 +159,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
158 |
inversion_state['cfg'], inversion_state['cfg'].edit_guidance_scale)
|
159 |
|
160 |
if device == 'cuda':
|
|
|
161 |
torch.cuda.empty_cache()
|
162 |
|
163 |
|
|
|
120 |
inversion_state = ImageEditorDemo.invert(pipe_inversion.to(device), input_image, description_prompt, config,
|
121 |
[rnri_iterations, rnri_alpha, rnri_lr], device)
|
122 |
if device == 'cuda':
|
123 |
+
pipe_inversion.to('cpu')
|
124 |
torch.cuda.empty_cache()
|
125 |
# pipe_inversion = pipe_inversion.to('cpu')
|
126 |
print(f"#### 3 #### pipe_inversion.device: {pipe_inversion.device}")
|
|
|
159 |
inversion_state['cfg'], inversion_state['cfg'].edit_guidance_scale)
|
160 |
|
161 |
if device == 'cuda':
|
162 |
+
pipe_inference.to('cpu')
|
163 |
torch.cuda.empty_cache()
|
164 |
|
165 |
|