"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "8a692739c029179297aad7a46e38c523149e3231"
Unverified Commit 9800cc5e authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[InstructPix2Pix] Fix pipeline implementation and add docs (#4844)

* initial evident fixes.

* instructpix2pix fixes.

* add: entry to doc.

* address PR feedback.

* make fix-copies
parent 541bb6ee
...@@ -35,4 +35,12 @@ Make sure to check out the Schedulers [guide](/using-diffusers/schedulers) to le ...@@ -35,4 +35,12 @@ Make sure to check out the Schedulers [guide](/using-diffusers/schedulers) to le
- save_lora_weights - save_lora_weights
## StableDiffusionPipelineOutput ## StableDiffusionPipelineOutput
[[autodoc]] pipelines.stable_diffusion.StableDiffusionPipelineOutput [[autodoc]] pipelines.stable_diffusion.StableDiffusionPipelineOutput
\ No newline at end of file
## StableDiffusionXLInstructPix2PixPipeline
[[autodoc]] StableDiffusionXLInstructPix2PixPipeline
- __call__
- all
## StableDiffusionXLPipelineOutput
[[autodoc]] pipelines.stable_diffusion_xl.StableDiffusionXLPipelineOutput
\ No newline at end of file
...@@ -68,7 +68,7 @@ class StableDiffusionXLInstructPix2PixPipelineFastTests( ...@@ -68,7 +68,7 @@ class StableDiffusionXLInstructPix2PixPipelineFastTests(
addition_embed_type="text_time", addition_embed_type="text_time",
addition_time_embed_dim=8, addition_time_embed_dim=8,
transformer_layers_per_block=(1, 2), transformer_layers_per_block=(1, 2),
projection_class_embeddings_input_dim=72, # 5 * 8 + 32 projection_class_embeddings_input_dim=80, # 5 * 8 + 32
cross_attention_dim=64, cross_attention_dim=64,
) )
...@@ -118,12 +118,11 @@ class StableDiffusionXLInstructPix2PixPipelineFastTests( ...@@ -118,12 +118,11 @@ class StableDiffusionXLInstructPix2PixPipelineFastTests(
"tokenizer": tokenizer, "tokenizer": tokenizer,
"text_encoder_2": text_encoder_2, "text_encoder_2": text_encoder_2,
"tokenizer_2": tokenizer_2, "tokenizer_2": tokenizer_2,
"requires_aesthetics_score": True,
} }
return components return components
def get_dummy_inputs(self, device, seed=0): def get_dummy_inputs(self, device, seed=0):
image = floats_tensor((1, 3, 32, 32), rng=random.Random(seed)).to(device) image = floats_tensor((1, 3, 64, 64), rng=random.Random(seed)).to(device)
image = image / 2 + 0.5 image = image / 2 + 0.5
if str(device).startswith("mps"): if str(device).startswith("mps"):
generator = torch.manual_seed(seed) generator = torch.manual_seed(seed)
...@@ -142,7 +141,6 @@ class StableDiffusionXLInstructPix2PixPipelineFastTests( ...@@ -142,7 +141,6 @@ class StableDiffusionXLInstructPix2PixPipelineFastTests(
def test_components_function(self): def test_components_function(self):
init_components = self.get_dummy_components() init_components = self.get_dummy_components()
init_components.pop("requires_aesthetics_score")
pipe = self.pipeline_class(**init_components) pipe = self.pipeline_class(**init_components)
self.assertTrue(hasattr(pipe, "components")) self.assertTrue(hasattr(pipe, "components"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment