Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,10 +8,9 @@ transformers.logging.set_verbosity_error()
|
|
| 8 |
|
| 9 |
# 모델 경로 목록
|
| 10 |
model_paths = {
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
# 다른 모델 경로도 여기에 추가할 수 있습니다.
|
| 15 |
}
|
| 16 |
|
| 17 |
# VAE 경로
|
|
@@ -34,8 +33,7 @@ def generate_image(prompt, negative_prompt, model_name, steps, sampler, cfg_scal
|
|
| 34 |
prompt=prompt,
|
| 35 |
negative_prompt=negative_prompt,
|
| 36 |
num_inference_steps=steps,
|
| 37 |
-
|
| 38 |
-
cfg_scale=cfg_scale,
|
| 39 |
width=width,
|
| 40 |
height=height,
|
| 41 |
generator=generator,
|
|
@@ -57,7 +55,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 57 |
model_name = gr.Dropdown(
|
| 58 |
label="Model (모델 선택)",
|
| 59 |
choices=list(model_paths.keys()),
|
| 60 |
-
value="
|
| 61 |
interactive=True
|
| 62 |
)
|
| 63 |
|
|
@@ -83,8 +81,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 83 |
with gr.Row():
|
| 84 |
sampler = gr.Dropdown(
|
| 85 |
label="Sampler (샘플러)",
|
| 86 |
-
choices=["
|
| 87 |
-
value="
|
| 88 |
)
|
| 89 |
|
| 90 |
with gr.Row():
|
|
@@ -146,4 +144,3 @@ with gr.Blocks(css=css) as demo:
|
|
| 146 |
)
|
| 147 |
|
| 148 |
demo.launch()
|
| 149 |
-
|
|
|
|
| 8 |
|
| 9 |
# 모델 경로 목록
|
| 10 |
model_paths = {
|
| 11 |
+
"CompVis/stable-diffusion-v1-4": "CompVis/stable-diffusion-v1-4",
|
| 12 |
+
"runwayml/stable-diffusion-v1-5": "runwayml/stable-diffusion-v1-5",
|
| 13 |
+
"stabilityai/stable-diffusion-2-1": "stabilityai/stable-diffusion-2-1"
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
# VAE 경로
|
|
|
|
| 33 |
prompt=prompt,
|
| 34 |
negative_prompt=negative_prompt,
|
| 35 |
num_inference_steps=steps,
|
| 36 |
+
guidance_scale=cfg_scale,
|
|
|
|
| 37 |
width=width,
|
| 38 |
height=height,
|
| 39 |
generator=generator,
|
|
|
|
| 55 |
model_name = gr.Dropdown(
|
| 56 |
label="Model (모델 선택)",
|
| 57 |
choices=list(model_paths.keys()),
|
| 58 |
+
value="runwayml/stable-diffusion-v1-5",
|
| 59 |
interactive=True
|
| 60 |
)
|
| 61 |
|
|
|
|
| 81 |
with gr.Row():
|
| 82 |
sampler = gr.Dropdown(
|
| 83 |
label="Sampler (샘플러)",
|
| 84 |
+
choices=["ddim", "ddpm", "pndm"],
|
| 85 |
+
value="ddpm"
|
| 86 |
)
|
| 87 |
|
| 88 |
with gr.Row():
|
|
|
|
| 144 |
)
|
| 145 |
|
| 146 |
demo.launch()
|
|
|