Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,20 +26,16 @@ def generate(
|
|
| 26 |
output_image_name,
|
| 27 |
verbose
|
| 28 |
):
|
| 29 |
-
|
| 30 |
-
|
| 31 |
if verbose:
|
| 32 |
verbose_opt = '--verbose'
|
| 33 |
else:
|
| 34 |
verbose_opt = ''
|
| 35 |
|
| 36 |
-
|
| 37 |
if stable_diffusion_model == '2':
|
| 38 |
sd_model = "minecraft-skins"
|
| 39 |
else:
|
| 40 |
sd_model = "minecraft-skins-sdxl"
|
| 41 |
|
| 42 |
-
|
| 43 |
subprocess.run(["python", f"Python_Scripts/{sd_model}.py", prompt, num_inference_steps, guidance_scale, num_images_per_prompt, model_precision_type, seed, output_image_name, verbose_opt])
|
| 44 |
|
| 45 |
return os.path.join(f"output_minecraft_skins/{output_image_name}")
|
|
@@ -52,7 +48,7 @@ stable_diffusion_model = gr.Dropdown(["2", "xl"], interactive=True, label="Stabl
|
|
| 52 |
num_inference_steps = gr.Number(value=50, minimum=1, precision=0, interactive=True, label="Inference Steps", 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")
|
| 53 |
|
| 54 |
guidance_scale = gr.Number(value=7.5, minimum=0.1, interactive=True, label="Guidance Scale", info="How closely the generated image adheres to the prompt")
|
| 55 |
-
|
| 56 |
num_images_per_prompt = gr.Number(value=1, minimum=1, precision=0, interactive=True, label="Images Per Prompt", info="The number of images to make with the prompt")
|
| 57 |
|
| 58 |
model_precision_type = gr.Dropdown(["fp16", "fp32"], value="fp16", interactive=True, label="Model Precision Type", info="The precision type to load the model, like fp16 which is faster, or fp32 which gives better results")
|
|
@@ -85,4 +81,4 @@ gr.Interface(
|
|
| 85 |
description="Make AI generated Minecraft Skins by a Finetuned Stable Diffusion Version!<br>Model used: https://github.com/Nick088Official/Stable_Diffusion_Finetuned_Minecraft_Skin_Generator<br>Hugging Face Space made by [Nick088](https://linktr.ee/Nick088)",
|
| 86 |
examples=examples,
|
| 87 |
concurrency_limit=20,
|
| 88 |
-
).launch(show_api=False)
|
|
|
|
| 26 |
output_image_name,
|
| 27 |
verbose
|
| 28 |
):
|
|
|
|
|
|
|
| 29 |
if verbose:
|
| 30 |
verbose_opt = '--verbose'
|
| 31 |
else:
|
| 32 |
verbose_opt = ''
|
| 33 |
|
|
|
|
| 34 |
if stable_diffusion_model == '2':
|
| 35 |
sd_model = "minecraft-skins"
|
| 36 |
else:
|
| 37 |
sd_model = "minecraft-skins-sdxl"
|
| 38 |
|
|
|
|
| 39 |
subprocess.run(["python", f"Python_Scripts/{sd_model}.py", prompt, num_inference_steps, guidance_scale, num_images_per_prompt, model_precision_type, seed, output_image_name, verbose_opt])
|
| 40 |
|
| 41 |
return os.path.join(f"output_minecraft_skins/{output_image_name}")
|
|
|
|
| 48 |
num_inference_steps = gr.Number(value=50, minimum=1, precision=0, interactive=True, label="Inference Steps", 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")
|
| 49 |
|
| 50 |
guidance_scale = gr.Number(value=7.5, minimum=0.1, interactive=True, label="Guidance Scale", info="How closely the generated image adheres to the prompt")
|
| 51 |
+
|
| 52 |
num_images_per_prompt = gr.Number(value=1, minimum=1, precision=0, interactive=True, label="Images Per Prompt", info="The number of images to make with the prompt")
|
| 53 |
|
| 54 |
model_precision_type = gr.Dropdown(["fp16", "fp32"], value="fp16", interactive=True, label="Model Precision Type", info="The precision type to load the model, like fp16 which is faster, or fp32 which gives better results")
|
|
|
|
| 81 |
description="Make AI generated Minecraft Skins by a Finetuned Stable Diffusion Version!<br>Model used: https://github.com/Nick088Official/Stable_Diffusion_Finetuned_Minecraft_Skin_Generator<br>Hugging Face Space made by [Nick088](https://linktr.ee/Nick088)",
|
| 82 |
examples=examples,
|
| 83 |
concurrency_limit=20,
|
| 84 |
+
).launch(show_api=False)
|