Spaces:
Running
Running
feat: remove seed_3
Browse files- app.py +2 -3
- stable_diffusion_inference.py +1 -2
app.py
CHANGED
|
@@ -42,7 +42,6 @@ body {
|
|
| 42 |
background-repeat: no-repeat;
|
| 43 |
background-attachment: fixed;
|
| 44 |
background-position: center;
|
| 45 |
-
background-size: cover;
|
| 46 |
}
|
| 47 |
.gr-button-primary {
|
| 48 |
background: linear-gradient(90deg, #6b9dfc, #8c6bfc) !important;
|
|
@@ -214,7 +213,7 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
| 214 |
value=50,
|
| 215 |
)
|
| 216 |
|
| 217 |
-
gr.Examples(examples=examples, inputs=[prompt], outputs=[result_3
|
| 218 |
cache_examples=True, cache_mode="lazy")
|
| 219 |
|
| 220 |
gr.on(
|
|
@@ -250,7 +249,7 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
| 250 |
guidance_scale,
|
| 251 |
num_inference_steps_3,
|
| 252 |
],
|
| 253 |
-
outputs=[result_3
|
| 254 |
)
|
| 255 |
|
| 256 |
if __name__ == "__main__":
|
|
|
|
| 42 |
background-repeat: no-repeat;
|
| 43 |
background-attachment: fixed;
|
| 44 |
background-position: center;
|
|
|
|
| 45 |
}
|
| 46 |
.gr-button-primary {
|
| 47 |
background: linear-gradient(90deg, #6b9dfc, #8c6bfc) !important;
|
|
|
|
| 213 |
value=50,
|
| 214 |
)
|
| 215 |
|
| 216 |
+
gr.Examples(examples=examples, inputs=[prompt], outputs=[result_3], fn=inference_sd,
|
| 217 |
cache_examples=True, cache_mode="lazy")
|
| 218 |
|
| 219 |
gr.on(
|
|
|
|
| 249 |
guidance_scale,
|
| 250 |
num_inference_steps_3,
|
| 251 |
],
|
| 252 |
+
outputs=[result_3],
|
| 253 |
)
|
| 254 |
|
| 255 |
if __name__ == "__main__":
|
stable_diffusion_inference.py
CHANGED
|
@@ -53,7 +53,6 @@ def inference_sd(prompt,
|
|
| 53 |
progress=gr.Progress(track_tqdm=True), ):
|
| 54 |
if randomize_seed:
|
| 55 |
seed = random.randint(0, MAX_SEED)
|
| 56 |
-
logger.info(f'seed: {seed}')
|
| 57 |
generator = torch.Generator().manual_seed(seed)
|
| 58 |
|
| 59 |
logger.info('Generating image ...')
|
|
@@ -66,4 +65,4 @@ def inference_sd(prompt,
|
|
| 66 |
num_inference_steps=num_inference_steps,
|
| 67 |
generator=generator,
|
| 68 |
).images[0]
|
| 69 |
-
return image
|
|
|
|
| 53 |
progress=gr.Progress(track_tqdm=True), ):
|
| 54 |
if randomize_seed:
|
| 55 |
seed = random.randint(0, MAX_SEED)
|
|
|
|
| 56 |
generator = torch.Generator().manual_seed(seed)
|
| 57 |
|
| 58 |
logger.info('Generating image ...')
|
|
|
|
| 65 |
num_inference_steps=num_inference_steps,
|
| 66 |
generator=generator,
|
| 67 |
).images[0]
|
| 68 |
+
return image
|