mirror of
https://github.com/Stability-AI/generative-models.git
synced 2026-02-12 01:04:26 +01:00
fix noisy latent handling
This commit is contained in:
@@ -68,9 +68,7 @@ class TestInference:
|
||||
assert output is not None
|
||||
|
||||
@pytest.mark.parametrize("sampler_enum", Sampler)
|
||||
@pytest.mark.parametrize(
|
||||
"use_init_image", [True, False], ids=["img2img", "txt2img"]
|
||||
)
|
||||
@pytest.mark.parametrize("use_init_image", [True, False], ids=["img2img", "txt2img"])
|
||||
def test_sdxl_with_refiner(
|
||||
self,
|
||||
sdxl_pipelines: Tuple[SamplingPipeline, SamplingPipeline],
|
||||
@@ -81,13 +79,12 @@ class TestInference:
|
||||
if use_init_image:
|
||||
output = base_pipeline.image_to_image(
|
||||
params=SamplingParams(sampler=sampler_enum.value, steps=10),
|
||||
image=self.create_init_image(
|
||||
base_pipeline.specs.height, base_pipeline.specs.width
|
||||
),
|
||||
image=self.create_init_image(base_pipeline.specs.height, base_pipeline.specs.width),
|
||||
prompt="A professional photograph of an astronaut riding a pig",
|
||||
negative_prompt="",
|
||||
samples=1,
|
||||
return_latents=True,
|
||||
noise_strength=0.15,
|
||||
)
|
||||
else:
|
||||
output = base_pipeline.text_to_image(
|
||||
@@ -96,16 +93,17 @@ class TestInference:
|
||||
negative_prompt="",
|
||||
samples=1,
|
||||
return_latents=True,
|
||||
noise_strength=0.15,
|
||||
)
|
||||
|
||||
assert isinstance(output, (tuple, list))
|
||||
samples, samples_z = output
|
||||
assert samples is not None
|
||||
assert samples_z is not None
|
||||
refiner_pipeline.refiner(
|
||||
refiner_pipeline.refiner(
|
||||
image=samples_z,
|
||||
prompt="A professional photograph of an astronaut riding a pig",
|
||||
params=SamplingParams(sampler=sampler_enum.value, steps=40, img2img_strength=0.20),
|
||||
params=SamplingParams(sampler=sampler_enum.value, steps=40, img2img_strength=0.15),
|
||||
negative_prompt="",
|
||||
samples=1,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user