poipii commited on
Commit
5eed10a
1 Parent(s): 372d15d

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +8 -6
pipeline.py CHANGED
@@ -915,7 +915,7 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
915
  # image = self.decode_latents(upscale_latents)
916
 
917
  if return_latents:
918
- return latents
919
  else:
920
  image = self.decode_latents(latents)
921
 
@@ -1011,7 +1011,7 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
1011
  (nsfw) content, according to the `safety_checker`.
1012
  """
1013
 
1014
- latents = self.__call__(
1015
  prompt=prompt,
1016
  negative_prompt=negative_prompt,
1017
  height=height,
@@ -1032,19 +1032,21 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
1032
  )
1033
 
1034
  latents = torch.nn.functional.interpolate(latents, size=(int(height*resize_scale)//8, int(width*resize_scale)//8))
1035
-
 
 
1036
  return self.__call__(
1037
  prompt=prompt,
1038
  negative_prompt=negative_prompt,
1039
- height=height*resize_scale,
1040
- width=width*resize_scale,
1041
  num_inference_steps=num_inference_steps,
1042
  guidance_scale=guidance_scale,
1043
  strength=strength,
1044
  num_images_per_prompt=num_images_per_prompt,
1045
  eta=eta,
1046
  generator=generator,
1047
- latents=latents,
1048
  return_latents=False,
1049
  max_embeddings_multiples=max_embeddings_multiples,
1050
  output_type=output_type,
 
915
  # image = self.decode_latents(upscale_latents)
916
 
917
  if return_latents:
918
+ return latents,noise,init_latents_orig
919
  else:
920
  image = self.decode_latents(latents)
921
 
 
1011
  (nsfw) content, according to the `safety_checker`.
1012
  """
1013
 
1014
+ latents,noise,init_latents_orig = self.__call__(
1015
  prompt=prompt,
1016
  negative_prompt=negative_prompt,
1017
  height=height,
 
1032
  )
1033
 
1034
  latents = torch.nn.functional.interpolate(latents, size=(int(height*resize_scale)//8, int(width*resize_scale)//8))
1035
+ print("noise")
1036
+ print(noise)
1037
+
1038
  return self.__call__(
1039
  prompt=prompt,
1040
  negative_prompt=negative_prompt,
1041
+ height=height,
1042
+ width=width,
1043
  num_inference_steps=num_inference_steps,
1044
  guidance_scale=guidance_scale,
1045
  strength=strength,
1046
  num_images_per_prompt=num_images_per_prompt,
1047
  eta=eta,
1048
  generator=generator,
1049
+ latents=None,
1050
  return_latents=False,
1051
  max_embeddings_multiples=max_embeddings_multiples,
1052
  output_type=output_type,