Skip to content

Commit

Permalink
Merge pull request #29 from KevinBatdorf/add-send-prompt-to-replicate…
Browse files Browse the repository at this point in the history
…-endpoint

Add webhook for prompt sharing
  • Loading branch information
KevinBatdorf authored Oct 6, 2022
2 parents 355fc57 + d2dadf5 commit 80719d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/models/StableDiffusion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useModel } from '../hooks/useModel';
import { usePrediction } from '../hooks/usePrediction';
import { useAuthStore } from '../state/auth';
import { useGlobalState } from '../state/global';
import { useSettingsStore } from '../state/settings';
import { ImageLike } from '../types';

type StableDiffusionProps = {
Expand All @@ -28,6 +29,7 @@ export const StableDiffusion = ({
const { data: modelInfo } = useModel('stability-ai/stable-diffusion');
const { importingMessage, setMaybeImporting, maybeImporting } =
useGlobalState();
const { has } = useSettingsStore();
const { apiToken } = useAuthStore();
const [errorMsg, setErrorMsg] = useState('');
const [statusMessage, setStatusMessage] = useState('');
Expand Down Expand Up @@ -76,6 +78,9 @@ export const StableDiffusion = ({
data: {
input: { width, height, prompt },
version: modelInfo.latest_version.id,
webhook_completed: has('optIns', 'prompt-share')
? 'https://www.block-diffusion.com/api/v1/replicate'
: undefined,
},
}).catch((error) => {
if (error.detail) {
Expand Down

0 comments on commit 80719d3

Please sign in to comment.