Instructions to use sh20raj/Genivis with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use sh20raj/Genivis with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("sh20raj/Genivis", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
archived: auto-save before deletion
Browse files- generate.py +17 -0
- model_index.json +32 -0
- test.py +6 -0
generate.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from diffusers import FluxPipeline
|
| 3 |
+
|
| 4 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
|
| 5 |
+
pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
|
| 6 |
+
|
| 7 |
+
prompt = "A cat holding a sign that says hello world"
|
| 8 |
+
image = pipe(
|
| 9 |
+
prompt,
|
| 10 |
+
height=1024,
|
| 11 |
+
width=1024,
|
| 12 |
+
guidance_scale=3.5,
|
| 13 |
+
num_inference_steps=50,
|
| 14 |
+
max_sequence_length=512,
|
| 15 |
+
generator=torch.Generator("cpu").manual_seed(0)
|
| 16 |
+
).images[0]
|
| 17 |
+
image.save("flux-dev.png")
|
model_index.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "GeneVisPipeline",
|
| 3 |
+
"_diffusers_version": "0.30.0.dev0",
|
| 4 |
+
"scheduler": [
|
| 5 |
+
"diffusers",
|
| 6 |
+
"FlowMatchEulerDiscreteScheduler"
|
| 7 |
+
],
|
| 8 |
+
"text_encoder": [
|
| 9 |
+
"transformers",
|
| 10 |
+
"CLIPTextModel"
|
| 11 |
+
],
|
| 12 |
+
"text_encoder_2": [
|
| 13 |
+
"transformers",
|
| 14 |
+
"T5EncoderModel"
|
| 15 |
+
],
|
| 16 |
+
"tokenizer": [
|
| 17 |
+
"transformers",
|
| 18 |
+
"CLIPTokenizer"
|
| 19 |
+
],
|
| 20 |
+
"tokenizer_2": [
|
| 21 |
+
"transformers",
|
| 22 |
+
"T5TokenizerFast"
|
| 23 |
+
],
|
| 24 |
+
"transformer": [
|
| 25 |
+
"diffusers",
|
| 26 |
+
"GeneVisTransformer2DModel"
|
| 27 |
+
],
|
| 28 |
+
"vae": [
|
| 29 |
+
"diffusers",
|
| 30 |
+
"AutoencoderKL"
|
| 31 |
+
]
|
| 32 |
+
}
|
test.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from diffusers import DiffusionPipeline
|
| 2 |
+
|
| 3 |
+
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev")
|
| 4 |
+
|
| 5 |
+
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
|
| 6 |
+
image = pipe(prompt).images[0]
|