Nick088 commited on
Commit
68de506
β€’
1 Parent(s): 9f6e2bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -2,6 +2,7 @@ import subprocess
2
  import os
3
  import gradio as gr
4
  import torch
 
5
  from PIL import Image, ImageEnhance
6
  import spaces
7
 
@@ -49,6 +50,7 @@ num_inference_steps = gr.Slider(label="Number of Inference Steps", info="The num
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)
@@ -64,12 +66,13 @@ gr.Interface(
64
  guidance_scale,
65
  model_precision_type,
66
  seed,
 
67
  filename,
68
  model_3d,
69
  verbose
70
  ],
71
  outputs=[
72
- gr.Image(label="Generated Minecraft Skin Image Asset", elem_classes="pixelated checkered"),
73
  gr.Model3D(clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model View of the Skin")
74
  ],
75
  title="Minecraft Skin Generator",
 
2
  import os
3
  import gradio as gr
4
  import torch
5
+ import numpy as np
6
  from PIL import Image, ImageEnhance
7
  import spaces
8
 
 
50
  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)
51
  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")
52
  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")
53
+ num_images_per_prompt = gr.Slider(label="Number of Images to generate with the settings",minimum=1, maximum=4, step=1, value=1)
54
  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")
55
  model_3d = gr.Checkbox(label="See as 3D Model too", info="View the generated skin as a 3D Model too", value=True)
56
  verbose = gr.Checkbox(label="Verbose Output", info="Produce more detailed output while running", value=False)
 
66
  guidance_scale,
67
  model_precision_type,
68
  seed,
69
+ num_images_per_prompt,
70
  filename,
71
  model_3d,
72
  verbose
73
  ],
74
  outputs=[
75
+ gr.Gallery(label="Generated Minecraft Skin Image Assets", elem_id="gallery", elem_classes="pixelated checkered"),
76
  gr.Model3D(clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model View of the Skin")
77
  ],
78
  title="Minecraft Skin Generator",