Nedyalko Demirev commited on
Commit
815ab0f
1 Parent(s): 0b41ac1

added login / ezreal

Browse files
Files changed (6) hide show
  1. README.md +3 -0
  2. login.py +2 -0
  3. main.py +1 -1
  4. nvidia.py +5 -6
  5. pictures/ezreal221.png +0 -0
  6. requirements.py +3 -0
README.md CHANGED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ## Run
2
+ 1. `pip install transformers==4.19.2 diffusers invisible-watermark`
3
+ 2. `pip install diffusers["torch"]`
login.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ from huggingface_hub import login
2
+ login()
main.py CHANGED
@@ -3,7 +3,7 @@ from nvidia import execute_nvidia
3
 
4
 
5
  prompt = "ezreal"
6
- filename = "ezreal22"
7
 
8
 
9
  execute_nvidia(prompt,filename)
 
3
 
4
 
5
  prompt = "ezreal"
6
+ filename = "ezreal221"
7
 
8
 
9
  execute_nvidia(prompt,filename)
nvidia.py CHANGED
@@ -1,16 +1,15 @@
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
 
 
1
  from diffusers import StableDiffusionPipeline
2
+ import torch
3
 
4
  def execute_nvidia(prompt, filename):
 
5
  DEVICE = 'cuda'
6
+ model_id = "runwayml/stable-diffusion-v1-5"
7
  pipe = StableDiffusionPipeline.from_pretrained(
8
+ model_id,
9
+ use_auth_token=True,
10
+ # torch_dtype=torch.float16
11
  ).to(DEVICE)
 
12
  pipe.enable_attention_slicing()
 
13
  image = pipe(prompt).images[0]
14
  image.save("pictures/"+ filename +".png")
15
 
pictures/ezreal221.png ADDED
requirements.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Specify the required packages and their versions
2
+ click==8.1
3
+ transformers==4.19