Nedyalko Demirev commited on
Commit
76b138f
1 Parent(s): 4d1d773

main created

Browse files
__pycache__/nvidia.cpython-310.pyc ADDED
Binary file (578 Bytes). View file
 
main.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ from click import prompt
2
+ from nvidia import execute_nvidia
3
+
4
+
5
+ prompt = "ezreal"
6
+ filename = "ezreal22"
7
+
8
+
9
+ execute_nvidia(prompt,filename)
nvidia.py CHANGED
@@ -1,14 +1,16 @@
1
  from diffusers import StableDiffusionPipeline
2
 
3
- DEVICE = 'cuda'
4
-
5
- pipe = StableDiffusionPipeline.from_pretrained(
6
- "CompVis/stable-diffusion-v1-4",
7
- use_auth_token=True
8
- ).to(DEVICE)
9
- prompt = "Elon Musk riding elephant on the moon."
10
- pipe.enable_attention_slicing()
11
- # _ = pipe(prompt, num_inference_steps=1)
12
- image = pipe(prompt).images[0]
13
- image.save("pictures/elon_musk.png")
 
 
14
 
 
1
  from diffusers import StableDiffusionPipeline
2
 
3
+ def execute_nvidia(prompt, filename):
4
+
5
+ DEVICE = 'cuda'
6
+
7
+ pipe = StableDiffusionPipeline.from_pretrained(
8
+ "CompVis/stable-diffusion-v1-4",
9
+ use_auth_token=True
10
+ ).to(DEVICE)
11
+ # prompt = "Elon Musk riding elephant on the moon."
12
+ pipe.enable_attention_slicing()
13
+ # _ = pipe(prompt, num_inference_steps=1)
14
+ image = pipe(prompt).images[0]
15
+ image.save("pictures/"+ filename +".png")
16
 
pictures/ezreal22.png ADDED