revert
Browse files
custum_3d_diffusion/custum_pipeline/unifield_pipeline_img2mvimg.py
CHANGED
@@ -204,8 +204,7 @@ class StableDiffusionImage2MVCustomPipeline(
|
|
204 |
# batch_size = len(image)
|
205 |
# else:
|
206 |
# batch_size = image.shape[0]
|
207 |
-
|
208 |
-
device = "cuda"
|
209 |
# here `guidance_scale` is defined analog to the guidance weight `w` of equation (2)
|
210 |
# of the Imagen paper: https://arxiv.org/pdf/2205.11487.pdf . `guidance_scale = 1`
|
211 |
# corresponds to doing no classifier free guidance.
|
@@ -214,9 +213,7 @@ class StableDiffusionImage2MVCustomPipeline(
|
|
214 |
# 3. Encode input image
|
215 |
emb_image = image
|
216 |
|
217 |
-
image_embeddings = self._encode_image(emb_image, device, num_images_per_prompt, do_classifier_free_guidance)
|
218 |
-
print("DEBUG: image_embeddings", image_embeddings.dtype, image_embeddings.device)
|
219 |
-
print("DEBUG: version v111")
|
220 |
cond_latents = self.encode_latents(image, image_embeddings.device, image_embeddings.dtype, height_cond, width_cond)
|
221 |
cond_latents = torch.cat([torch.zeros_like(cond_latents), cond_latents]) if do_classifier_free_guidance else cond_latents
|
222 |
image_pixels = self.feature_extractor(images=emb_image, return_tensors="pt").pixel_values
|
|
|
204 |
# batch_size = len(image)
|
205 |
# else:
|
206 |
# batch_size = image.shape[0]
|
207 |
+
device = self._execution_device
|
|
|
208 |
# here `guidance_scale` is defined analog to the guidance weight `w` of equation (2)
|
209 |
# of the Imagen paper: https://arxiv.org/pdf/2205.11487.pdf . `guidance_scale = 1`
|
210 |
# corresponds to doing no classifier free guidance.
|
|
|
213 |
# 3. Encode input image
|
214 |
emb_image = image
|
215 |
|
216 |
+
image_embeddings = self._encode_image(emb_image, device, num_images_per_prompt, do_classifier_free_guidance)
|
|
|
|
|
217 |
cond_latents = self.encode_latents(image, image_embeddings.device, image_embeddings.dtype, height_cond, width_cond)
|
218 |
cond_latents = torch.cat([torch.zeros_like(cond_latents), cond_latents]) if do_classifier_free_guidance else cond_latents
|
219 |
image_pixels = self.feature_extractor(images=emb_image, return_tensors="pt").pixel_values
|