Files changed (3) hide show
  1. README.md +13 -16
  2. model_index.json +0 -1
  3. vae/config.json +1 -1
README.md CHANGED
@@ -2,7 +2,7 @@
2
  license: openrail++
3
  tags:
4
  - stable-diffusion
5
- - image-to-image
6
  ---
7
  # SD-XL 1.0-refiner Model Card
8
  ![row01](01.png)
@@ -58,22 +58,20 @@ In addition make sure to install `transformers`, `safetensors`, `accelerate` as
58
  pip install invisible_watermark transformers accelerate safetensors
59
  ```
60
 
61
- Yon can then use the refiner to improve images.
62
-
63
  ```py
 
64
  import torch
65
- from diffusers import StableDiffusionXLImg2ImgPipeline
66
- from diffusers.utils import load_image
67
-
68
- pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
69
- "stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True
70
- )
71
- pipe = pipe.to("cuda")
72
- url = "https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/aa_xl/000000009.png"
73
-
74
- init_image = load_image(url).convert("RGB")
75
- prompt = "a photo of an astronaut riding a horse on mars"
76
- image = pipe(prompt, image=init_image).images
77
  ```
78
 
79
  When using `torch >= 2.0`, you can improve the inference speed by 20-30% with torch.compile. Simple wrap the unet with torch compile before running the pipeline:
@@ -89,7 +87,6 @@ instead of `.to("cuda")`:
89
  + pipe.enable_model_cpu_offload()
90
  ```
91
 
92
- For more advanced use cases, please have a look at [the docs](https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl).
93
 
94
  ## Uses
95
 
 
2
  license: openrail++
3
  tags:
4
  - stable-diffusion
5
+ - text-to-image
6
  ---
7
  # SD-XL 1.0-refiner Model Card
8
  ![row01](01.png)
 
58
  pip install invisible_watermark transformers accelerate safetensors
59
  ```
60
 
61
+ You can use the model then as follows
 
62
  ```py
63
+ from diffusers import DiffusionPipeline
64
  import torch
65
+
66
+ pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1-0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
67
+ pipe.to("cuda")
68
+
69
+ # if using torch < 2.0
70
+ # pipe.enable_xformers_memory_efficient_attention()
71
+
72
+ prompt = "An astronaut riding a green horse"
73
+
74
+ images = pipe(prompt=prompt).images[0]
 
 
75
  ```
76
 
77
  When using `torch >= 2.0`, you can improve the inference speed by 20-30% with torch.compile. Simple wrap the unet with torch compile before running the pipeline:
 
87
  + pipe.enable_model_cpu_offload()
88
  ```
89
 
 
90
 
91
  ## Uses
92
 
model_index.json CHANGED
@@ -2,7 +2,6 @@
2
  "_class_name": "StableDiffusionXLImg2ImgPipeline",
3
  "_diffusers_version": "0.19.0.dev0",
4
  "force_zeros_for_empty_prompt": false,
5
- "add_watermarker": null,
6
  "requires_aesthetics_score": true,
7
  "scheduler": [
8
  "diffusers",
 
2
  "_class_name": "StableDiffusionXLImg2ImgPipeline",
3
  "_diffusers_version": "0.19.0.dev0",
4
  "force_zeros_for_empty_prompt": false,
 
5
  "requires_aesthetics_score": true,
6
  "scheduler": [
7
  "diffusers",
vae/config.json CHANGED
@@ -21,7 +21,7 @@
21
  "layers_per_block": 2,
22
  "norm_num_groups": 32,
23
  "out_channels": 3,
24
- "sample_size": 1024,
25
  "scaling_factor": 0.13025,
26
  "up_block_types": [
27
  "UpDecoderBlock2D",
 
21
  "layers_per_block": 2,
22
  "norm_num_groups": 32,
23
  "out_channels": 3,
24
+ "sample_size": 512,
25
  "scaling_factor": 0.13025,
26
  "up_block_types": [
27
  "UpDecoderBlock2D",