Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,16 +29,13 @@ def infer(
|
|
| 29 |
width: int,
|
| 30 |
height: int,
|
| 31 |
num_inference_steps: int,
|
| 32 |
-
progress=gr.Progress(track_tqdm=True),
|
| 33 |
model_id: Optional[str] = 'CompVis/stable-diffusion-v1-4',
|
| 34 |
seed: Optional[int] = 42,
|
| 35 |
guidance_scale: Optional[float] = 7.0,
|
|
|
|
| 36 |
):
|
| 37 |
generator = torch.Generator().manual_seed(seed)
|
| 38 |
|
| 39 |
-
print('!!!!!!')
|
| 40 |
-
print(model_id)
|
| 41 |
-
print('!!!!!!')
|
| 42 |
if model_id != model_repo_id_default:
|
| 43 |
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch_dtype)
|
| 44 |
pipe = pipe.to(device)
|
|
@@ -143,11 +140,12 @@ with gr.Blocks(css=css) as demo:
|
|
| 143 |
inputs=[
|
| 144 |
prompt,
|
| 145 |
negative_prompt,
|
| 146 |
-
seed,
|
| 147 |
width,
|
| 148 |
height,
|
| 149 |
-
guidance_scale,
|
| 150 |
num_inference_steps,
|
|
|
|
|
|
|
|
|
|
| 151 |
],
|
| 152 |
outputs=[
|
| 153 |
result,
|
|
|
|
| 29 |
width: int,
|
| 30 |
height: int,
|
| 31 |
num_inference_steps: int,
|
|
|
|
| 32 |
model_id: Optional[str] = 'CompVis/stable-diffusion-v1-4',
|
| 33 |
seed: Optional[int] = 42,
|
| 34 |
guidance_scale: Optional[float] = 7.0,
|
| 35 |
+
progress=gr.Progress(track_tqdm=True),
|
| 36 |
):
|
| 37 |
generator = torch.Generator().manual_seed(seed)
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
if model_id != model_repo_id_default:
|
| 40 |
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch_dtype)
|
| 41 |
pipe = pipe.to(device)
|
|
|
|
| 140 |
inputs=[
|
| 141 |
prompt,
|
| 142 |
negative_prompt,
|
|
|
|
| 143 |
width,
|
| 144 |
height,
|
|
|
|
| 145 |
num_inference_steps,
|
| 146 |
+
model_id,
|
| 147 |
+
seed,
|
| 148 |
+
guidance_scale,
|
| 149 |
],
|
| 150 |
outputs=[
|
| 151 |
result,
|