This commit is contained in:
sigma
2026-04-13 00:04:20 +00:00
committed by system
parent 2f633b7f46
commit cbc2ac12dd

26
app.py
View File

@@ -531,18 +531,20 @@ def infer(
print(f"Rewritten Prompt: {prompt}")
# Generate the image
image = pipe(
image=pil_images if len(pil_images) > 0 else None,
prompt=prompt,
height=height,
width=width,
negative_prompt=negative_prompt,
num_inference_steps=num_inference_steps,
generator=generator,
true_cfg_scale=true_guidance_scale,
num_images_per_prompt=num_images_per_prompt,
).images
# Enable Autocast for better results.
with torch.autocast(device_type="cuda", dtype=torch.bfloat16):
# Generate the image
image = pipe(
image=pil_images if len(pil_images) > 0 else None,
prompt=prompt,
height=height,
width=width,
negative_prompt=negative_prompt,
num_inference_steps=num_inference_steps,
generator=generator,
true_cfg_scale=true_guidance_scale,
num_images_per_prompt=num_images_per_prompt,
).images
_maintain_session_state(
primary_buffers=image,