h1t commited on
Commit
ca10f59
1 Parent(s): bc9726e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -13
README.md CHANGED
@@ -21,27 +21,27 @@ Here is a simple example:
21
  import torch
22
  from diffusers import StableDiffusionPipeline, TCDScheduler
23
 
24
- device = "cuda"
25
- base_model_id = "stabilityai/stable-diffusion-2-1-base"
26
- tcd_lora_id = "h1t/TCD-SD21-base-LoRA"
27
 
28
- pipe = StableDiffusionPipeline.from_pretrained(base_model_id, torch_dtype=torch.float16, variant="fp16").to(device)
29
- pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
30
 
31
  pipe.load_lora_weights(tcd_lora_id)
32
  pipe.fuse_lora()
33
 
34
- prompt = "Beautiful woman, bubblegum pink, lemon yellow, minty blue, futuristic, high-detail, epic composition, watercolor."
35
 
36
- image = pipe(
37
- prompt=prompt,
38
- num_inference_steps=4,
39
- guidance_scale=0,
40
- # Eta (referred to as `gamma` in the paper) is used to control the stochasticity in every step.
41
  # A value of 0.3 often yields good results.
42
  # We recommend using a higher eta when increasing the number of inference steps.
43
- eta=0.3,
44
- generator=torch.Generator(device=device).manual_seed(0),
45
  ).images[0]
46
  ```
47
 
 
21
  import torch
22
  from diffusers import StableDiffusionPipeline, TCDScheduler
23
 
24
+ device = "cuda"
25
+ base_model_id = "stabilityai/stable-diffusion-2-1-base"
26
+ tcd_lora_id = "h1t/TCD-SD21-base-LoRA"
27
 
28
+ pipe = StableDiffusionPipeline.from_pretrained(base_model_id, torch_dtype=torch.float16, variant="fp16").to(device)
29
+ pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
30
 
31
  pipe.load_lora_weights(tcd_lora_id)
32
  pipe.fuse_lora()
33
 
34
+ prompt = "Beautiful woman, bubblegum pink, lemon yellow, minty blue, futuristic, high-detail, epic composition, watercolor."
35
 
36
+ image = pipe(
37
+ prompt=prompt,
38
+ num_inference_steps=4,
39
+ guidance_scale=0,
40
+ # Eta (referred to as `gamma` in the paper) is used to control the stochasticity in every step.
41
  # A value of 0.3 often yields good results.
42
  # We recommend using a higher eta when increasing the number of inference steps.
43
+ eta=0.3,
44
+ generator=torch.Generator(device=device).manual_seed(0),
45
  ).images[0]
46
  ```
47