Spaces:
vilarin
/
Running on Zero

vilarin commited on
Commit
d94350f
1 Parent(s): 4b5a4e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -69,10 +69,10 @@ def generate_image(
69
  height=1024,
70
  scale=1.5,
71
  steps=30,
72
- clip=3):
73
 
74
-
75
- seed = random.randint(0, MAX_SEED)
76
  generator = torch.Generator().manual_seed(seed)
77
 
78
  prompt = str(translator.translate(prompt, 'English'))
@@ -86,7 +86,6 @@ def generate_image(
86
  height=height,
87
  guidance_scale=scale,
88
  num_inference_steps=steps,
89
- clip_skip=clip,
90
  generator = generator,
91
  )
92
  return image.images[0]
@@ -110,7 +109,7 @@ examples = [
110
 
111
  with gr.Blocks(css=CSS, js=JS, theme="soft") as demo:
112
  gr.HTML("<h1><center>SD3M🦄</center></h1>")
113
- gr.HTML("<p><center><a href='https://huggingface.co/stabilityai/stable-diffusion-3-medium'>sd3m</a> text-to-image generation</center><br><center>Multi-Languages. Adding default prompts to enhance.</center></p>")
114
  with gr.Group():
115
  with gr.Row():
116
  prompt = gr.Textbox(label='Enter Your Prompt', value="best quality, HD, aesthetic", scale=6)
@@ -149,12 +148,12 @@ with gr.Blocks(css=CSS, js=JS, theme="soft") as demo:
149
  step=1,
150
  value=30,
151
  )
152
- clip = gr.Slider(
153
- label="Clip Skip",
154
- minimum=1,
155
- maximum=10,
156
  step=1,
157
- value=3,
158
  )
159
  gr.Examples(
160
  examples=examples,
 
69
  height=1024,
70
  scale=1.5,
71
  steps=30,
72
+ seed=-1):
73
 
74
+ if seed == -1:
75
+ seed = random.randint(0, MAX_SEED)
76
  generator = torch.Generator().manual_seed(seed)
77
 
78
  prompt = str(translator.translate(prompt, 'English'))
 
86
  height=height,
87
  guidance_scale=scale,
88
  num_inference_steps=steps,
 
89
  generator = generator,
90
  )
91
  return image.images[0]
 
109
 
110
  with gr.Blocks(css=CSS, js=JS, theme="soft") as demo:
111
  gr.HTML("<h1><center>SD3M🦄</center></h1>")
112
+ gr.HTML("<p><center><a href='https://huggingface.co/stabilityai/stable-diffusion-3-medium'>sd3m</a> text-to-image generation</center><br><center>Multi-Languages. Seed -1 Get Random.</center></p>")
113
  with gr.Group():
114
  with gr.Row():
115
  prompt = gr.Textbox(label='Enter Your Prompt', value="best quality, HD, aesthetic", scale=6)
 
148
  step=1,
149
  value=30,
150
  )
151
+ seed = gr.Slider(
152
+ label="Seed",
153
+ minimum=-1,
154
+ maximum=10000000000000,
155
  step=1,
156
+ value=-1,
157
  )
158
  gr.Examples(
159
  examples=examples,