Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype,
|
|
| 18 |
pipe = pipe.to(device)
|
| 19 |
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
| 21 |
-
MAX_IMAGE_SIZE =
|
| 22 |
|
| 23 |
|
| 24 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
|
@@ -66,7 +66,7 @@ css = """
|
|
| 66 |
|
| 67 |
with gr.Blocks(css=css) as demo:
|
| 68 |
with gr.Column(elem_id="col-container"):
|
| 69 |
-
gr.Markdown(" #
|
| 70 |
|
| 71 |
with gr.Row():
|
| 72 |
prompt = gr.Text(
|
|
@@ -102,35 +102,35 @@ with gr.Blocks(css=css) as demo:
|
|
| 102 |
with gr.Row():
|
| 103 |
width = gr.Slider(
|
| 104 |
label="Width",
|
| 105 |
-
minimum=
|
| 106 |
maximum=MAX_IMAGE_SIZE,
|
| 107 |
step=32,
|
| 108 |
-
value=
|
| 109 |
)
|
| 110 |
|
| 111 |
height = gr.Slider(
|
| 112 |
label="Height",
|
| 113 |
-
minimum=
|
| 114 |
maximum=MAX_IMAGE_SIZE,
|
| 115 |
step=32,
|
| 116 |
-
value=
|
| 117 |
)
|
| 118 |
|
| 119 |
with gr.Row():
|
| 120 |
guidance_scale = gr.Slider(
|
| 121 |
label="Guidance scale",
|
| 122 |
-
minimum=
|
| 123 |
maximum=10.0,
|
| 124 |
step=0.1,
|
| 125 |
-
value=
|
| 126 |
)
|
| 127 |
|
| 128 |
num_inference_steps = gr.Slider(
|
| 129 |
label="Number of inference steps",
|
| 130 |
-
minimum=
|
| 131 |
maximum=50,
|
| 132 |
-
step=
|
| 133 |
-
value=
|
| 134 |
)
|
| 135 |
|
| 136 |
gr.Examples(examples=examples, inputs=[prompt])
|
|
|
|
| 18 |
pipe = pipe.to(device)
|
| 19 |
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
| 21 |
+
MAX_IMAGE_SIZE = 768
|
| 22 |
|
| 23 |
|
| 24 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
|
|
|
| 66 |
|
| 67 |
with gr.Blocks(css=css) as demo:
|
| 68 |
with gr.Column(elem_id="col-container"):
|
| 69 |
+
gr.Markdown(" # Photo Real")
|
| 70 |
|
| 71 |
with gr.Row():
|
| 72 |
prompt = gr.Text(
|
|
|
|
| 102 |
with gr.Row():
|
| 103 |
width = gr.Slider(
|
| 104 |
label="Width",
|
| 105 |
+
minimum=512,
|
| 106 |
maximum=MAX_IMAGE_SIZE,
|
| 107 |
step=32,
|
| 108 |
+
value=768, # Replace with defaults that work for your model
|
| 109 |
)
|
| 110 |
|
| 111 |
height = gr.Slider(
|
| 112 |
label="Height",
|
| 113 |
+
minimum=512,
|
| 114 |
maximum=MAX_IMAGE_SIZE,
|
| 115 |
step=32,
|
| 116 |
+
value=768, # Replace with defaults that work for your model
|
| 117 |
)
|
| 118 |
|
| 119 |
with gr.Row():
|
| 120 |
guidance_scale = gr.Slider(
|
| 121 |
label="Guidance scale",
|
| 122 |
+
minimum=5.0,
|
| 123 |
maximum=10.0,
|
| 124 |
step=0.1,
|
| 125 |
+
value=5.0, # Replace with defaults that work for your model
|
| 126 |
)
|
| 127 |
|
| 128 |
num_inference_steps = gr.Slider(
|
| 129 |
label="Number of inference steps",
|
| 130 |
+
minimum=20,
|
| 131 |
maximum=50,
|
| 132 |
+
step=5,
|
| 133 |
+
value=25, # Replace with defaults that work for your model
|
| 134 |
)
|
| 135 |
|
| 136 |
gr.Examples(examples=examples, inputs=[prompt])
|