Spaces:
Sleeping
Sleeping
updates to nvidia
Browse files- Dockerfile +2 -1
- main.py +3 -3
Dockerfile
CHANGED
@@ -6,7 +6,8 @@ FROM python:3.9
|
|
6 |
# Python and Pip
|
7 |
RUN apt-get update && apt-get install -y \
|
8 |
python3-pip \
|
9 |
-
wget
|
|
|
10 |
|
11 |
WORKDIR /code
|
12 |
|
|
|
6 |
# Python and Pip
|
7 |
RUN apt-get update && apt-get install -y \
|
8 |
python3-pip \
|
9 |
+
wget \
|
10 |
+
nvidia-container-toolkit
|
11 |
|
12 |
WORKDIR /code
|
13 |
|
main.py
CHANGED
@@ -32,11 +32,11 @@ def generate_image(prompt, inference_steps, model):
|
|
32 |
#pipe = pipe.to("cuda")
|
33 |
|
34 |
pipeline = DiffusionPipeline.from_pretrained(str(model))
|
35 |
-
|
36 |
-
generator = torch.Generator("
|
37 |
pipeline.scheduler = DPMSolverMultistepScheduler.from_config(pipeline.scheduler.config)
|
38 |
#image = pipeline(prompt, generator=generator).images[0]
|
39 |
-
image = pipeline(prompt,
|
40 |
|
41 |
|
42 |
#prompt = "a photo of an astronaut riding a horse on mars"
|
|
|
32 |
#pipe = pipe.to("cuda")
|
33 |
|
34 |
pipeline = DiffusionPipeline.from_pretrained(str(model))
|
35 |
+
pipeline = pipeline.to("cuda")
|
36 |
+
#generator = torch.Generator("gpu").manual_seed(0)
|
37 |
pipeline.scheduler = DPMSolverMultistepScheduler.from_config(pipeline.scheduler.config)
|
38 |
#image = pipeline(prompt, generator=generator).images[0]
|
39 |
+
image = pipeline(prompt, num_inference_steps=int(inference_steps)).images[0]
|
40 |
|
41 |
|
42 |
#prompt = "a photo of an astronaut riding a horse on mars"
|