Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -291,12 +291,12 @@ dict_styles = {
|
|
| 291 |
'Oil Painting':'styles/learned_embeds_oil.bin',
|
| 292 |
}
|
| 293 |
|
| 294 |
-
def inference(prompt, seed, style):
|
| 295 |
|
| 296 |
if prompt is not None and style is not None and seed is not None:
|
| 297 |
style = dict_styles[style]
|
| 298 |
torch.manual_seed(seed)
|
| 299 |
-
result = generate_with_prompt_style_guidance(prompt, style,seed,num_inference_steps
|
| 300 |
return np.array(result)
|
| 301 |
else:
|
| 302 |
return None
|
|
@@ -309,7 +309,7 @@ demo = gr.Interface(inference,
|
|
| 309 |
inputs = [gr.Textbox(label='Prompt', value='Pink Ferrari Car'), gr.Textbox(label='Seed', value=24041975),
|
| 310 |
gr.Dropdown(['Dr Strange', 'GTA-5', 'Manga', 'Pokemon','Illustration','Matrix','Oil Painting'], label='Style', value='Dr Strange'),
|
| 311 |
gr.Slider(
|
| 312 |
-
minimum=
|
| 313 |
maximum=20,
|
| 314 |
value=10,
|
| 315 |
step=5,
|
|
|
|
| 291 |
'Oil Painting':'styles/learned_embeds_oil.bin',
|
| 292 |
}
|
| 293 |
|
| 294 |
+
def inference(prompt, seed, style,num_inference_steps,guidance_scale):
|
| 295 |
|
| 296 |
if prompt is not None and style is not None and seed is not None:
|
| 297 |
style = dict_styles[style]
|
| 298 |
torch.manual_seed(seed)
|
| 299 |
+
result = generate_with_prompt_style_guidance(prompt, style,seed,num_inference_steps,guidance_scale)
|
| 300 |
return np.array(result)
|
| 301 |
else:
|
| 302 |
return None
|
|
|
|
| 309 |
inputs = [gr.Textbox(label='Prompt', value='Pink Ferrari Car'), gr.Textbox(label='Seed', value=24041975),
|
| 310 |
gr.Dropdown(['Dr Strange', 'GTA-5', 'Manga', 'Pokemon','Illustration','Matrix','Oil Painting'], label='Style', value='Dr Strange'),
|
| 311 |
gr.Slider(
|
| 312 |
+
minimum=5,
|
| 313 |
maximum=20,
|
| 314 |
value=10,
|
| 315 |
step=5,
|