Spaces:
Runtime error
Runtime error
Jordan Legg
commited on
Commit
β’
e6d3c53
1
Parent(s):
22e5a11
try
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import spaces
|
|
5 |
import torch
|
6 |
from PIL import Image
|
7 |
from torchvision import transforms
|
8 |
-
from diffusers import DiffusionPipeline, AutoencoderKL
|
9 |
|
10 |
# Define constants
|
11 |
dtype = torch.bfloat16
|
@@ -56,17 +56,16 @@ def infer(prompt, init_image=None, seed=42, randomize_seed=False, width=1024, he
|
|
56 |
width=width,
|
57 |
num_inference_steps=num_inference_steps,
|
58 |
generator=generator,
|
59 |
-
guidance_scale=0.0
|
|
|
60 |
)
|
61 |
image = result.images[0]
|
62 |
print(f"Generated image shape: {image.size}")
|
63 |
|
64 |
# Inspect the output and log relevant details
|
65 |
print("Logging detailed information for text2img:")
|
66 |
-
|
67 |
-
|
68 |
-
log_tensor_info(param, name)
|
69 |
-
|
70 |
print("Logging complete.")
|
71 |
except Exception as e:
|
72 |
print(f"Pipeline call failed with error: {e}")
|
@@ -122,6 +121,7 @@ def infer(prompt, init_image=None, seed=42, randomize_seed=False, width=1024, he
|
|
122 |
return image, seed
|
123 |
|
124 |
|
|
|
125 |
# Define example prompts
|
126 |
examples = [
|
127 |
"a tiny astronaut hatching from an egg on the moon",
|
|
|
5 |
import torch
|
6 |
from PIL import Image
|
7 |
from torchvision import transforms
|
8 |
+
from diffusers import DiffusionPipeline, AutoencoderKL, CLIPTextModel, T5EncoderModel
|
9 |
|
10 |
# Define constants
|
11 |
dtype = torch.bfloat16
|
|
|
56 |
width=width,
|
57 |
num_inference_steps=num_inference_steps,
|
58 |
generator=generator,
|
59 |
+
guidance_scale=0.0,
|
60 |
+
max_sequence_length=256
|
61 |
)
|
62 |
image = result.images[0]
|
63 |
print(f"Generated image shape: {image.size}")
|
64 |
|
65 |
# Inspect the output and log relevant details
|
66 |
print("Logging detailed information for text2img:")
|
67 |
+
# Log intermediate latent information if accessible
|
68 |
+
|
|
|
|
|
69 |
print("Logging complete.")
|
70 |
except Exception as e:
|
71 |
print(f"Pipeline call failed with error: {e}")
|
|
|
121 |
return image, seed
|
122 |
|
123 |
|
124 |
+
|
125 |
# Define example prompts
|
126 |
examples = [
|
127 |
"a tiny astronaut hatching from an egg on the moon",
|