Instructions to use yijunwang2/krea2-outpaint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use yijunwang2/krea2-outpaint with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("krea/Krea-2-Turbo", torch_dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("yijunwang2/krea2-outpaint") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
Upload private Krea 2 Outpaint release candidate
Browse files- .gitattributes +6 -0
- NOTICE +0 -1
- README.md +42 -4
- SHA256SUMS +10 -4
- example.py +0 -1
- outpaint.py +0 -1
- showcase/3d_extend_both_sides.webp +3 -0
- showcase/3d_source.webp +3 -0
- showcase/photo_extend_right.webp +3 -0
- showcase/photo_source.webp +3 -0
- showcase/watercolor_extend_down.webp +3 -0
- showcase/watercolor_source.webp +3 -0
.gitattributes
CHANGED
|
@@ -34,3 +34,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
LICENSE.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
LICENSE.pdf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
showcase/3d_extend_both_sides.webp filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
showcase/3d_source.webp filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
showcase/photo_extend_right.webp filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
showcase/photo_source.webp filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
showcase/watercolor_extend_down.webp filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
showcase/watercolor_source.webp filter=lfs diff=lfs merge=lfs -text
|
NOTICE
CHANGED
|
@@ -12,4 +12,3 @@ Upstream edit pipeline: https://huggingface.co/ostris/Krea2OstrisEdit
|
|
| 12 |
|
| 13 |
This is an unofficial community release and is not endorsed by Krea or Ostris.
|
| 14 |
Training data is not included.
|
| 15 |
-
|
|
|
|
| 12 |
|
| 13 |
This is an unofficial community release and is not endorsed by Krea or Ostris.
|
| 14 |
Training data is not included.
|
|
|
README.md
CHANGED
|
@@ -40,8 +40,47 @@ LICENSE.pdf Krea 2 Community License
|
|
| 40 |
PIPELINE_LICENSE Apache-2.0 license for pipeline/helper code
|
| 41 |
NOTICE attribution and derivative-work notice
|
| 42 |
SHA256SUMS release artifact hashes
|
|
|
|
| 43 |
```
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
## Input contract
|
| 46 |
|
| 47 |
The model takes:
|
|
@@ -73,9 +112,9 @@ chooses the smaller intermediate blank region first.
|
|
| 73 |
| Reference VLM encoding | disabled |
|
| 74 |
| Reference K/V cache | enabled |
|
| 75 |
|
| 76 |
-
The adapter
|
| 77 |
-
`
|
| 78 |
-
|
| 79 |
|
| 80 |
## Usage
|
| 81 |
|
|
@@ -142,4 +181,3 @@ The LoRA weights are a derivative of Krea 2 and are released under the Krea 2
|
|
| 142 |
Community License in `LICENSE.pdf`. Pipeline and helper code are distributed
|
| 143 |
under Apache-2.0 in `PIPELINE_LICENSE`. This is an unofficial community release
|
| 144 |
and is not endorsed by Krea or Ostris.
|
| 145 |
-
|
|
|
|
| 40 |
PIPELINE_LICENSE Apache-2.0 license for pipeline/helper code
|
| 41 |
NOTICE attribution and derivative-work notice
|
| 42 |
SHA256SUMS release artifact hashes
|
| 43 |
+
showcase/ fully synthetic source/output examples
|
| 44 |
```
|
| 45 |
|
| 46 |
+
## Tested capabilities
|
| 47 |
+
|
| 48 |
+
The release candidate has been tested across photorealistic, watercolor, and
|
| 49 |
+
stylized 3D scenes, with the known source placed on different parts of the
|
| 50 |
+
canvas:
|
| 51 |
+
|
| 52 |
+
- left-anchored source with generation extending to the right;
|
| 53 |
+
- top-anchored source with generation extending downward;
|
| 54 |
+
- centered source with generation extending across both horizontal sides;
|
| 55 |
+
- square-to-landscape and square-to-portrait canvas changes;
|
| 56 |
+
- coherent continuation of perspective, lighting, texture, and repeated scene
|
| 57 |
+
structure.
|
| 58 |
+
|
| 59 |
+
Every source shown below was generated from the unmodified Krea 2 base model.
|
| 60 |
+
The corresponding result then uses this Outpaint LoRA. No external image,
|
| 61 |
+
real-person likeness, artist name, or existing character IP was used.
|
| 62 |
+
Each source and result is the first 8-step output from its preselected prompt,
|
| 63 |
+
placement, and fixed seed (`17072033` through `17072038`); all three planned
|
| 64 |
+
groups are shown and no rerolls were removed.
|
| 65 |
+
|
| 66 |
+
### Photorealistic interior: extend right
|
| 67 |
+
|
| 68 |
+
| Base-model source | Outpaint result |
|
| 69 |
+
|:---:|:---:|
|
| 70 |
+
|  |  |
|
| 71 |
+
|
| 72 |
+
### Watercolor village: extend down
|
| 73 |
+
|
| 74 |
+
| Base-model source | Outpaint result |
|
| 75 |
+
|:---:|:---:|
|
| 76 |
+
|  |  |
|
| 77 |
+
|
| 78 |
+
### Stylized 3D night market: extend both sides
|
| 79 |
+
|
| 80 |
+
| Base-model source | Outpaint result |
|
| 81 |
+
|:---:|:---:|
|
| 82 |
+
|  |  |
|
| 83 |
+
|
| 84 |
## Input contract
|
| 85 |
|
| 86 |
The model takes:
|
|
|
|
| 112 |
| Reference VLM encoding | disabled |
|
| 113 |
| Reference K/V cache | enabled |
|
| 114 |
|
| 115 |
+
The adapter uses isolated reference attention, so `kv_cache=True` and
|
| 116 |
+
`encode_reference_in_prompt=False` are part of the model contract rather than
|
| 117 |
+
optional speed tweaks.
|
| 118 |
|
| 119 |
## Usage
|
| 120 |
|
|
|
|
| 181 |
Community License in `LICENSE.pdf`. Pipeline and helper code are distributed
|
| 182 |
under Apache-2.0 in `PIPELINE_LICENSE`. This is an unofficial community release
|
| 183 |
and is not endorsed by Krea or Ostris.
|
|
|
SHA256SUMS
CHANGED
|
@@ -1,8 +1,14 @@
|
|
| 1 |
b82a2805162bde714a4eb27b9063c4fc3345d08a30be055134a6160e5430ba74 LICENSE.pdf
|
| 2 |
-
|
| 3 |
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 PIPELINE_LICENSE
|
| 4 |
-
|
| 5 |
-
|
| 6 |
1de7c106ae978de21433152bdb4ba6b09118b33be81b7ee4851420f0013a7e76 krea2_outpaint_rank32.safetensors
|
| 7 |
-
|
| 8 |
877de17e0a9f7e42700d345b84a2ae9a3a3e559fdd5a69d4fb66a1db35f4449f pipeline.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
b82a2805162bde714a4eb27b9063c4fc3345d08a30be055134a6160e5430ba74 LICENSE.pdf
|
| 2 |
+
7b011fa1e03a47d475c67bc42d808ba6b585b8e90b55dd856b8571fb6683c05d NOTICE
|
| 3 |
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 PIPELINE_LICENSE
|
| 4 |
+
17abbccae531319bc804f1d672115afc77959198f9bb4402480f68eb8a166b8c README.md
|
| 5 |
+
b040b84b01857e953e551e84502591c9bd828b67f89c6c9b6e048484a02b3a82 example.py
|
| 6 |
1de7c106ae978de21433152bdb4ba6b09118b33be81b7ee4851420f0013a7e76 krea2_outpaint_rank32.safetensors
|
| 7 |
+
fc176da8a96ee0d62651be5263f18a0bc8b1f9cd243111a31ddce05a62851024 outpaint.py
|
| 8 |
877de17e0a9f7e42700d345b84a2ae9a3a3e559fdd5a69d4fb66a1db35f4449f pipeline.py
|
| 9 |
+
7381158f63813b73304dc3f7b4aa67e0fa0198c0d90f5a7fd0bb677762d89fe5 showcase/3d_extend_both_sides.webp
|
| 10 |
+
a9820f33bf3b01f98d8eacd90043f93194f067065eff25bb324516342f3e48b5 showcase/3d_source.webp
|
| 11 |
+
c22cde7637b181c62b4de7681f620431b0dec19a29e7d0d894cc4ab1e77c738b showcase/photo_extend_right.webp
|
| 12 |
+
f7b9c0f9dad314b3bccf5f551722c8e4d424332f9aab812f571bfd8539671010 showcase/photo_source.webp
|
| 13 |
+
bdd42512ecc882911b7b36de474dbe11756fb8050be093f072e21723974d4035 showcase/watercolor_extend_down.webp
|
| 14 |
+
6f0b4f20d16e505f55f9972d0e31f1bbc4de4040f5c7693e410c23f7b569a49d showcase/watercolor_source.webp
|
example.py
CHANGED
|
@@ -65,4 +65,3 @@ def main() -> None:
|
|
| 65 |
|
| 66 |
if __name__ == "__main__":
|
| 67 |
main()
|
| 68 |
-
|
|
|
|
| 65 |
|
| 66 |
if __name__ == "__main__":
|
| 67 |
main()
|
|
|
outpaint.py
CHANGED
|
@@ -147,4 +147,3 @@ def composite(generated: Image.Image, prepared: RegisteredSource) -> Image.Image
|
|
| 147 |
result = generated.copy()
|
| 148 |
result.paste(prepared.placed_source, prepared.bbox[:2], alpha_image)
|
| 149 |
return result
|
| 150 |
-
|
|
|
|
| 147 |
result = generated.copy()
|
| 148 |
result.paste(prepared.placed_source, prepared.bbox[:2], alpha_image)
|
| 149 |
return result
|
|
|
showcase/3d_extend_both_sides.webp
ADDED
|
Git LFS Details
|
showcase/3d_source.webp
ADDED
|
Git LFS Details
|
showcase/photo_extend_right.webp
ADDED
|
Git LFS Details
|
showcase/photo_source.webp
ADDED
|
Git LFS Details
|
showcase/watercolor_extend_down.webp
ADDED
|
Git LFS Details
|
showcase/watercolor_source.webp
ADDED
|
Git LFS Details
|