autocast
This commit is contained in:
2
app.py
2
app.py
@@ -531,6 +531,8 @@ def infer(
|
|||||||
print(f"Rewritten Prompt: {prompt}")
|
print(f"Rewritten Prompt: {prompt}")
|
||||||
|
|
||||||
|
|
||||||
|
# Enable Autocast for better results.
|
||||||
|
with torch.autocast(device_type="cuda", dtype=torch.bfloat16):
|
||||||
# Generate the image
|
# Generate the image
|
||||||
image = pipe(
|
image = pipe(
|
||||||
image=pil_images if len(pil_images) > 0 else None,
|
image=pil_images if len(pil_images) > 0 else None,
|
||||||
|
|||||||
Reference in New Issue
Block a user