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

feat: Stable Diffusion #282

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

feat: Stable Diffusion #282

wants to merge 5 commits into from

Conversation

ishaansehgal99
Copy link
Collaborator

@ishaansehgal99 ishaansehgal99 commented Mar 6, 2024

Currently this just supports text-to-image. Not Image Inpainting, Super-Resolution or Depth-to-Image

Need these dependencies on machine:

RUN apt-get update && apt-get install ffmpeg libsm6 libxext6  -y

Accelerate launch:

CUDA_VISIBLE_DEVICES="0" accelerate launch --num_processes 1 --num_machines 1 --machine_rank 0  inference_api.py --pretrained_model_name_or_path <MODEL_NAME>

Curl command

curl -X POST "http://localhost:5000/generate?prompt="microsoft%20employee%20riding%20a%20horse%20on%20mars"" > output.png

Example:

CUDA_VISIBLE_DEVICES="0" accelerate launch --num_processes 1 --num_machines 1 --machine_rank 0  an_inference.py --pretrained_model_name_or_path stabilityai/stable-diffusion-xl-base-1.0 --allow_remote_files --torch_dtype=float16 --use_safetensors --variant="fp16"

API Requests:

curl -X POST "http://localhost:5000/generate?prompt=astronaut%20riding%20a%20horse%20on%20mars%20eating%20a%20pizza" > output.png

image

curl -X POST "http://localhost:5000/generate?prompt=Kubernetes%20cluster%20orchestrating%20a%20dance%20party%20for%20AI-powered%20robots%20on%20a%20cloud" > output.png

image

curl -X POST "http://localhost:5000/generate?prompt=Microsoft%20engineer%20enjoying%20a%20lively%20celebration%20with%20their%20team%20at%20KubeCon,%20animated%20cartoon" > output.png

output

Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.33%. Comparing base (de2b45c) to head (5d64ade).
Report is 45 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #282      +/-   ##
==========================================
+ Coverage   65.27%   65.33%   +0.06%     
==========================================
  Files          14       14              
  Lines        1123     1125       +2     
==========================================
+ Hits          733      735       +2     
  Misses        352      352              
  Partials       38       38              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant