Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def infer(
|
|
48 |
if randomize_seed:
|
49 |
seed = random.randint(0, MAX_SEED)
|
50 |
|
51 |
-
generator = torch.Generator(device).manual_seed(seed)
|
52 |
|
53 |
# Ensure text inputs are strings
|
54 |
prompt = str(prompt) if prompt else ""
|
@@ -57,10 +57,10 @@ def infer(
|
|
57 |
image = pipe(
|
58 |
prompt=prompt,
|
59 |
negative_prompt=negative_prompt,
|
60 |
-
guidance_scale=guidance_scale,
|
61 |
-
num_inference_steps=num_inference_steps,
|
62 |
-
width=width,
|
63 |
-
height=height,
|
64 |
generator=generator,
|
65 |
).images[0]
|
66 |
|
@@ -166,4 +166,4 @@ with gr.Blocks(css=css) as demo:
|
|
166 |
)
|
167 |
|
168 |
if __name__ == "__main__":
|
169 |
-
demo.launch()
|
|
|
48 |
if randomize_seed:
|
49 |
seed = random.randint(0, MAX_SEED)
|
50 |
|
51 |
+
generator = torch.Generator(device).manual_seed(int(seed))
|
52 |
|
53 |
# Ensure text inputs are strings
|
54 |
prompt = str(prompt) if prompt else ""
|
|
|
57 |
image = pipe(
|
58 |
prompt=prompt,
|
59 |
negative_prompt=negative_prompt,
|
60 |
+
guidance_scale=float(guidance_scale),
|
61 |
+
num_inference_steps=int(num_inference_steps),
|
62 |
+
width=int(width),
|
63 |
+
height=int(height),
|
64 |
generator=generator,
|
65 |
).images[0]
|
66 |
|
|
|
166 |
)
|
167 |
|
168 |
if __name__ == "__main__":
|
169 |
+
demo.launch()
|