Maitreyapatel
commited on
Commit
·
b96d5dc
1
Parent(s):
984b8af
markdown and scheduler changes
Browse files
app.py
CHANGED
|
@@ -39,8 +39,9 @@ class AttributionModel:
|
|
| 39 |
is_cuda = False
|
| 40 |
if torch.cuda.is_available():
|
| 41 |
is_cuda = True
|
| 42 |
-
|
| 43 |
-
|
|
|
|
| 44 |
if is_cuda:
|
| 45 |
self.pipe = self.pipe.to("cuda")
|
| 46 |
self.resize_transform = transforms.Resize(512, interpolation=transforms.InterpolationMode.BILINEAR)
|
|
@@ -140,7 +141,6 @@ Weight Modulation for User Attribution and Fingerprinting in Text-to-Image Diffu
|
|
| 140 |
|
| 141 |
gr.Markdown(
|
| 142 |
"""<h3>Demo: Text-to-Image (Stable diffusion 2) with random user attribution</h3>
|
| 143 |
-
WOUAF can be applied to other applications such as In-painting, Image-editing, Image Super-Resolution etc.
|
| 144 |
<br>More details at: <a href="https://arxiv.org/abs/2306.04744">Paper</a>
|
| 145 |
"""
|
| 146 |
)
|
|
@@ -171,7 +171,7 @@ Weight Modulation for User Attribution and Fingerprinting in Text-to-Image Diffu
|
|
| 171 |
)
|
| 172 |
|
| 173 |
with gr.Row():
|
| 174 |
-
steps = gr.Slider(label="Steps", minimum=
|
| 175 |
guidance_scale = gr.Slider(
|
| 176 |
label="Guidance Scale", minimum=0, maximum=10, value=9, step=0.1
|
| 177 |
)
|
|
|
|
| 39 |
is_cuda = False
|
| 40 |
if torch.cuda.is_available():
|
| 41 |
is_cuda = True
|
| 42 |
+
|
| 43 |
+
scheduler = EulerDiscreteScheduler.from_pretrained('stabilityai/stable-diffusion-2', subfolder="scheduler")
|
| 44 |
+
self.pipe = StableDiffusionPipeline.from_pretrained('stabilityai/stable-diffusion-2', scheduler=scheduler)#, safety_checker=None, torch_dtype=torch.float16)
|
| 45 |
if is_cuda:
|
| 46 |
self.pipe = self.pipe.to("cuda")
|
| 47 |
self.resize_transform = transforms.Resize(512, interpolation=transforms.InterpolationMode.BILINEAR)
|
|
|
|
| 141 |
|
| 142 |
gr.Markdown(
|
| 143 |
"""<h3>Demo: Text-to-Image (Stable diffusion 2) with random user attribution</h3>
|
|
|
|
| 144 |
<br>More details at: <a href="https://arxiv.org/abs/2306.04744">Paper</a>
|
| 145 |
"""
|
| 146 |
)
|
|
|
|
| 171 |
)
|
| 172 |
|
| 173 |
with gr.Row():
|
| 174 |
+
steps = gr.Slider(label="Steps", minimum=45, maximum=55, value=50, step=1)
|
| 175 |
guidance_scale = gr.Slider(
|
| 176 |
label="Guidance Scale", minimum=0, maximum=10, value=9, step=0.1
|
| 177 |
)
|