Spaces:
Running
on
Zero
Running
on
Zero
mcp-docstrings-and-type-hints
#3
by
xarical
- opened
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 🏃
|
|
4 |
colorFrom: purple
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
-
sdk_version:
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
license: other
|
|
|
4 |
colorFrom: purple
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 5.32.1
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
license: other
|
app.py
CHANGED
@@ -25,16 +25,31 @@ MAX_IMAGE_SIZE = 1024
|
|
25 |
|
26 |
@spaces.GPU(duration=65)
|
27 |
def infer(
|
28 |
-
prompt,
|
29 |
-
negative_prompt="",
|
30 |
-
seed=42,
|
31 |
-
randomize_seed=False,
|
32 |
-
width=1024,
|
33 |
-
height=1024,
|
34 |
-
guidance_scale=1.5,
|
35 |
-
num_inference_steps=8,
|
36 |
-
progress=gr.Progress(track_tqdm=True),
|
37 |
-
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
if randomize_seed:
|
39 |
seed = random.randint(0, MAX_SEED)
|
40 |
|
|
|
25 |
|
26 |
@spaces.GPU(duration=65)
|
27 |
def infer(
|
28 |
+
prompt: str,
|
29 |
+
negative_prompt: str = "",
|
30 |
+
seed: int = 42,
|
31 |
+
randomize_seed: bool = False,
|
32 |
+
width: int = 1024,
|
33 |
+
height: int = 1024,
|
34 |
+
guidance_scale: float = 1.5,
|
35 |
+
num_inference_steps: int = 8,
|
36 |
+
progress: gr.Progress = gr.Progress(track_tqdm=True),
|
37 |
+
) -> tuple["PIL.Image.Image", int]:
|
38 |
+
"""Generate an image using Stable Diffusion 3.5 Large TurboX.
|
39 |
+
|
40 |
+
Args:
|
41 |
+
prompt: The prompt to generate an image from
|
42 |
+
negative_prompt: The negative prompt
|
43 |
+
seed: The generation seed
|
44 |
+
randomize_seed: Whether to randomize the seed
|
45 |
+
width: The width of the generated image in pixels
|
46 |
+
height: The height of the generated image in pixels
|
47 |
+
guidance_scale: How closely the image should align with the prompt
|
48 |
+
num_inference_steps: Number of generation steps
|
49 |
+
|
50 |
+
Returns:
|
51 |
+
The generated image and the seed used for generation as a tuple of (PIL.Image.Image, seed)
|
52 |
+
"""
|
53 |
if randomize_seed:
|
54 |
seed = random.randint(0, MAX_SEED)
|
55 |
|