jepz commited on
Commit
389b0db
1 Parent(s): 44dd301

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -21,12 +21,12 @@ else:
21
 
22
  if torch.cuda.is_available():
23
  torch.cuda.max_memory_allocated(device=device)
24
- pipe = StableDiffusionImg2ImgPipeline.from_pretrained("Envvi/Inkpunk-Diffusion", torch_dtype=torch_dtype)
25
  #pipe = DiffusionPipeline.from_pretrained("Envvi/Inkpunk-Diffusion", torch_dtype=torch.float16, variant="fp16")
26
  pipe.enable_xformers_memory_efficient_attention()
27
  pipe = pipe.to(device)
28
  else:
29
- pipe = StableDiffusionImg2ImgPipeline.from_pretrained("Envvi/Inkpunk-Diffusion", torch_dtype=torch_dtype)
30
  pipe = pipe.to(device)
31
 
32
  MAX_SEED = np.iinfo(np.int32).max
@@ -79,7 +79,7 @@ with gr.Blocks(css=css) as demo:
79
 
80
  with gr.Column(elem_id="col-container"):
81
  gr.Markdown(f"""
82
- # Text-to-Image Gradio Template
83
  Currently running on {power_device}.
84
  """)
85
 
@@ -110,15 +110,16 @@ with gr.Blocks(css=css) as demo:
110
  visible=False,
111
  )
112
 
113
- seed = gr.Slider(
114
- label="Seed",
115
- minimum=0,
116
- maximum=MAX_SEED,
117
- step=1,
118
- value=0,
119
- )
 
120
 
121
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
122
 
123
  with gr.Row():
124
 
@@ -145,7 +146,7 @@ with gr.Blocks(css=css) as demo:
145
  minimum=0.0,
146
  maximum=10.0,
147
  step=0.1,
148
- value=0.75,
149
  )
150
 
151
  strength = gr.Slider(
@@ -153,7 +154,7 @@ with gr.Blocks(css=css) as demo:
153
  minimum=0.0,
154
  maximum=1.0,
155
  step=0.1,
156
- value=0.75,
157
  )
158
 
159
  gr.Examples(
 
21
 
22
  if torch.cuda.is_available():
23
  torch.cuda.max_memory_allocated(device=device)
24
+ pipe = StableDiffusionImg2ImgPipeline.from_pretrained("Envvi/Inkpunk-Diffusion", torch_dtype=torch_dtype, safety_checker = None, requires_safety_checker = False)
25
  #pipe = DiffusionPipeline.from_pretrained("Envvi/Inkpunk-Diffusion", torch_dtype=torch.float16, variant="fp16")
26
  pipe.enable_xformers_memory_efficient_attention()
27
  pipe = pipe.to(device)
28
  else:
29
+ pipe = StableDiffusionImg2ImgPipeline.from_pretrained("Envvi/Inkpunk-Diffusion", torch_dtype=torch_dtype, safety_checker = None, requires_safety_checker = False)
30
  pipe = pipe.to(device)
31
 
32
  MAX_SEED = np.iinfo(np.int32).max
 
79
 
80
  with gr.Column(elem_id="col-container"):
81
  gr.Markdown(f"""
82
+ # Image-to-Image Demo
83
  Currently running on {power_device}.
84
  """)
85
 
 
110
  visible=False,
111
  )
112
 
113
+ with gr.Row():
114
+ seed = gr.Slider(
115
+ label="Seed",
116
+ minimum=0,
117
+ maximum=MAX_SEED,
118
+ step=1,
119
+ value=0,
120
+ )
121
 
122
+ randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
123
 
124
  with gr.Row():
125
 
 
146
  minimum=0.0,
147
  maximum=10.0,
148
  step=0.1,
149
+ value=5.0,
150
  )
151
 
152
  strength = gr.Slider(
 
154
  minimum=0.0,
155
  maximum=1.0,
156
  step=0.1,
157
+ value=0.5,
158
  )
159
 
160
  gr.Examples(