Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ import os
|
|
| 3 |
import sys
|
| 4 |
import subprocess
|
| 5 |
|
| 6 |
-
hf_token = os.environ.get("HF_TOKEN")
|
| 7 |
import torch
|
| 8 |
from diffusers import StableDiffusion3Pipeline
|
| 9 |
from diffusers.models.controlnet_sd3 import ControlNetSD3Model
|
|
@@ -29,7 +28,6 @@ base_model = 'stabilityai/stable-diffusion-3-medium-diffusers'
|
|
| 29 |
pipe = StableDiffusion3CommonPipeline.from_pretrained(
|
| 30 |
base_model,
|
| 31 |
controlnet_list=['InstantX/SD3-Controlnet-Canny'],
|
| 32 |
-
hf_token=hf_token
|
| 33 |
)
|
| 34 |
pipe.to('cuda:0', torch.float16)
|
| 35 |
|
|
@@ -54,7 +52,6 @@ def infer(image_in, prompt):
|
|
| 54 |
guidance_scale=7.0,
|
| 55 |
height=1024,
|
| 56 |
width=1024,
|
| 57 |
-
latents=latents,
|
| 58 |
).images[0]
|
| 59 |
|
| 60 |
return image
|
|
|
|
| 3 |
import sys
|
| 4 |
import subprocess
|
| 5 |
|
|
|
|
| 6 |
import torch
|
| 7 |
from diffusers import StableDiffusion3Pipeline
|
| 8 |
from diffusers.models.controlnet_sd3 import ControlNetSD3Model
|
|
|
|
| 28 |
pipe = StableDiffusion3CommonPipeline.from_pretrained(
|
| 29 |
base_model,
|
| 30 |
controlnet_list=['InstantX/SD3-Controlnet-Canny'],
|
|
|
|
| 31 |
)
|
| 32 |
pipe.to('cuda:0', torch.float16)
|
| 33 |
|
|
|
|
| 52 |
guidance_scale=7.0,
|
| 53 |
height=1024,
|
| 54 |
width=1024,
|
|
|
|
| 55 |
).images[0]
|
| 56 |
|
| 57 |
return image
|