Spaces:
Runtime error
Runtime error
return not inplace .to(device)
Browse files- src/editor.py +4 -4
src/editor.py
CHANGED
@@ -55,17 +55,17 @@ class ImageEditorDemo:
|
|
55 |
self.inv_hp = inv_hp # [2, 0.1, 0.2]
|
56 |
self.edit_cfg = cfg.edit_guidance_scale
|
57 |
|
58 |
-
self.pipe_inversion.to(device)
|
59 |
self.last_latent = self.invert(self.original_image, description_prompt)
|
60 |
self.original_latent = self.last_latent
|
61 |
|
62 |
-
if device == 'cuda':
|
63 |
# after the inversion, we can move the inversion model to the CPU
|
64 |
-
|
65 |
|
66 |
pipe_inference.scheduler.set_noise_list(noise)
|
67 |
pipe_inference.set_progress_bar_config(disable=True)
|
68 |
-
self.pipe_inference.to(device)
|
69 |
|
70 |
def invert(self, init_image, base_prompt):
|
71 |
res = self.pipe_inversion(prompt=base_prompt,
|
|
|
55 |
self.inv_hp = inv_hp # [2, 0.1, 0.2]
|
56 |
self.edit_cfg = cfg.edit_guidance_scale
|
57 |
|
58 |
+
self.pipe_inversion = self.pipe_inversion.to(device)
|
59 |
self.last_latent = self.invert(self.original_image, description_prompt)
|
60 |
self.original_latent = self.last_latent
|
61 |
|
62 |
+
# if device == 'cuda':
|
63 |
# after the inversion, we can move the inversion model to the CPU
|
64 |
+
self.pipe_inversion = self.pipe_inversion.to('cpu')
|
65 |
|
66 |
pipe_inference.scheduler.set_noise_list(noise)
|
67 |
pipe_inference.set_progress_bar_config(disable=True)
|
68 |
+
self.pipe_inference = self.pipe_inference.to(device)
|
69 |
|
70 |
def invert(self, init_image, base_prompt):
|
71 |
res = self.pipe_inversion(prompt=base_prompt,
|