Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flux test #1104

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add flux draft
strint committed Aug 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8b1590746cdaa5bd3b4c1a2847d41d2dcd82ba1e
17 changes: 17 additions & 0 deletions onediff_diffusers_extensions/examples/flux/flux.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import torch
from diffusers import FluxPipeline

# Reference: https://github.com/huggingface/diffusers/pull/9043
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, revision='refs/pr/1')
# pipe.enable_model_cpu_offload()

prompt = "A cat holding a sign that says hello world"
out = pipe(
prompt=prompt,
guidance_scale=0.,
height=768,
width=1360,
num_inference_steps=4,
max_sequence_length=256,
).images[0]
out.save("image.png")