Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,16 +20,16 @@ def run_inference(prompt, stable_diffusion_model, num_inference_steps, guidance_
|
|
| 20 |
else:
|
| 21 |
sd_model = "minecraft-skins-sdxl"
|
| 22 |
|
| 23 |
-
command = f"Python_Scripts/{sd_model}.py '{prompt}' {num_inference_steps} {guidance_scale} {num_images_per_prompt} {model_precision_type} {output_image_name} {'--verbose' if verbose else ''}"
|
| 24 |
|
| 25 |
-
subprocess.run(["python", command],
|
| 26 |
|
| 27 |
return os.path.join(f"output_minecraft_skins/{output_image_name}")
|
| 28 |
|
| 29 |
|
| 30 |
# Define Gradio UI components
|
| 31 |
prompt_input = gr.Textbox(label="Your Prompt", info="What the Minecraft Skin should look like")
|
| 32 |
-
stable_diffusion_model_input = gr.Dropdown(['2', 'xl'], label="Stable Diffusion Model", info="Choose which Stable Diffusion Model to use, xl understands prompts better")
|
| 33 |
num_inference_steps_input = gr.Number(label="Number of Inference Steps", precision=0, value=25)
|
| 34 |
guidance_scale_input = gr.Number(minimum=0.1, value=7.5, label="Guidance Scale", info="The number of denoising steps of the image. More denoising steps usually lead to a higher quality image at the cost of slower inference")
|
| 35 |
num_images_per_prompt_input = gr.Number(minimum=1, value=1, precision=0, label="Number of Images per Prompt", info="The number of images to make with the prompt")
|
|
|
|
| 20 |
else:
|
| 21 |
sd_model = "minecraft-skins-sdxl"
|
| 22 |
|
| 23 |
+
command = f"Python_Scripts/{sd_model}.py '{prompt}' {num_inference_steps} {guidance_scale} {num_images_per_prompt} {model_precision_type} {seed} {output_image_name} {'--verbose' if verbose else ''}"
|
| 24 |
|
| 25 |
+
subprocess.run(["python", command], check=True)
|
| 26 |
|
| 27 |
return os.path.join(f"output_minecraft_skins/{output_image_name}")
|
| 28 |
|
| 29 |
|
| 30 |
# Define Gradio UI components
|
| 31 |
prompt_input = gr.Textbox(label="Your Prompt", info="What the Minecraft Skin should look like")
|
| 32 |
+
stable_diffusion_model_input = gr.Dropdown(['2', 'xl'], value="xl", label="Stable Diffusion Model", info="Choose which Stable Diffusion Model to use, xl understands prompts better")
|
| 33 |
num_inference_steps_input = gr.Number(label="Number of Inference Steps", precision=0, value=25)
|
| 34 |
guidance_scale_input = gr.Number(minimum=0.1, value=7.5, label="Guidance Scale", info="The number of denoising steps of the image. More denoising steps usually lead to a higher quality image at the cost of slower inference")
|
| 35 |
num_images_per_prompt_input = gr.Number(minimum=1, value=1, precision=0, label="Number of Images per Prompt", info="The number of images to make with the prompt")
|