Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,9 @@ else:
|
|
14 |
print("Using CPU")
|
15 |
|
16 |
|
|
|
|
|
|
|
17 |
subprocess.run(["git", "clone", "https://github.com/Nick088Official/Stable_Diffusion_Finetuned_Minecraft_Skin_Generator.git"])
|
18 |
|
19 |
os.chdir("Stable_Diffusion_Finetuned_Minecraft_Skin_Generator")
|
@@ -42,10 +45,10 @@ def run_inference(prompt, stable_diffusion_model, num_inference_steps, guidance_
|
|
42 |
# Define Gradio UI components
|
43 |
prompt = gr.Textbox(label="Your Prompt", info="What the Minecraft Skin should look like")
|
44 |
stable_diffusion_model = gr.Dropdown(['2', 'xl'], value="xl", label="Stable Diffusion Model", info="Choose which Stable Diffusion Model to use, xl understands prompts better")
|
45 |
-
num_inference_steps = gr.
|
46 |
-
guidance_scale = gr.
|
47 |
model_precision_type = gr.Dropdown(["fp16", "fp32"], value="fp16", label="Model Precision Type", info="The precision type to load the model, like fp16 which is faster, or fp32 which is more precise but more resource consuming")
|
48 |
-
seed = gr.
|
49 |
filename = gr.Textbox(label="Output Image Name", info="The name of the file of the output image skin, keep the.png", value="output-skin.png")
|
50 |
model_3d = gr.Checkbox(label="See as 3D Model too", info="View the generated skin as a 3D Model too", value=True)
|
51 |
verbose = gr.Checkbox(label="Verbose Output", info="Produce more detailed output while running", value=False)
|
|
|
14 |
print("Using CPU")
|
15 |
|
16 |
|
17 |
+
MAX_SEED = np.iinfo(np.int32).max
|
18 |
+
|
19 |
+
|
20 |
subprocess.run(["git", "clone", "https://github.com/Nick088Official/Stable_Diffusion_Finetuned_Minecraft_Skin_Generator.git"])
|
21 |
|
22 |
os.chdir("Stable_Diffusion_Finetuned_Minecraft_Skin_Generator")
|
|
|
45 |
# Define Gradio UI components
|
46 |
prompt = gr.Textbox(label="Your Prompt", info="What the Minecraft Skin should look like")
|
47 |
stable_diffusion_model = gr.Dropdown(['2', 'xl'], value="xl", label="Stable Diffusion Model", info="Choose which Stable Diffusion Model to use, xl understands prompts better")
|
48 |
+
num_inference_steps = gr.Slider(label="Number of 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", minimum=1, maximum=50, value=25, step=1)
|
49 |
+
guidance_scale = gr.Slider(label="Guidance Scale", info="Controls how much the image generation process follows the text prompt. Higher values make the image stick more closely to the input text.", minimum=0.0, maximum=10.0, value=7.5, step=0.1)
|
50 |
model_precision_type = gr.Dropdown(["fp16", "fp32"], value="fp16", label="Model Precision Type", info="The precision type to load the model, like fp16 which is faster, or fp32 which is more precise but more resource consuming")
|
51 |
+
seed = gr.Slider(value=42, minimum=0, maximum=MAX_SEED, step=1, label="Seed", info="A starting point to initiate the generation process, put 0 for a random one")
|
52 |
filename = gr.Textbox(label="Output Image Name", info="The name of the file of the output image skin, keep the.png", value="output-skin.png")
|
53 |
model_3d = gr.Checkbox(label="See as 3D Model too", info="View the generated skin as a 3D Model too", value=True)
|
54 |
verbose = gr.Checkbox(label="Verbose Output", info="Produce more detailed output while running", value=False)
|