leap-ai / headshots-starter Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://headshots-starter.vercel.app
License: MIT License
Home Page: https://headshots-starter.vercel.app
License: MIT License
Would it be possible to add a LICENSE file to this repo? Thank you.
Hey there,
I am able to send images and create models through astria/train-model/route.ts
However I never get any callback from Astria.
VERCEL URL is set as mydomainname.com
promptWebhookWithParams looks like this https://mydomainname.com/astria/prompt-webhook?user_id=someuserid&webhook_secret=somesecret
trainWebhookWithParams looks like this https://mydomainname.com/astria/train-webhook?user_id=someuserid&webhook_secret=somesecret
I've tried simpler URLs but still nothing
The headers of my request are correct since the action creates a model on Astria
The body of my request looks like this
const body = {
tune: {
title: name,
base_tune_id: 690204,
name: type,
branch: astriaTestModeIsOn ? "fast" : "sd15",
token: "ohwx",
image_urls: images,
callback: trainWebhookWithParams,
prompts_attributes: [
{
text: some prompt
,
callback: promptWebhookWithParams,
},
{
text: some prompt
,
callback: promptWebhookWithParams,
},
],
},
};
I've asked for help on Astria's discord but seem to be stuck, any idea of what could be going wrong?
I have followed all instructions but on the LeapAI website it says an astria API key is needed in order to run the headshot workflow. This isn't mentioned in the readme
Hello,
I am encountering an issue when deploying an application on Vercel, where the build process fails due to the APP_WEBHOOK_SECRET
environment variable apparently not being recognized or found, despite being set.
Here's the error message I receive during deployment:
Error: MISSING APP_WEBHOOK_SECRET!
at 46379 (/vercel/path0/.next/server/app/astria/prompt-webhook/route.js:1:1562)
...
> Build error occurred
Error: Failed to collect page data for /astria/prompt-webhook
...
I have confirmed that the APP_WEBHOOK_SECRET
is a randomly generated string (in this case, "yousayitsarandomstring?") as suggested in the documentation/README, and I've made sure to set it correctly in the project settings on Vercel.
Here are the steps I've taken to troubleshoot without success:
process.env.APP_WEBHOOK_SECRET
.I am wondering if there are any known issues with environment variable recognition during the build phase on Vercel, or if there are additional steps I need to take to ensure the environment variable is correctly passed and recognized by the build environment.
Any guidance or suggestions would be greatly appreciated.
Thank you!
If the output from train-webhook endpoint doesn't have enough items to fill headshots_part_2
, headshots_part_3
or headshots_part_4
, a TypeError will be thrown, because it's trying to iterate on undefined
to create allHeadshots
const.
This behavior makes the function execution to stop, and images are not saved on the database.
Output
Error message on Vercel console
I'll make a PR to fix this issue.
During deployment, it would fail on vercel when there are no optional variables like the STRIPE and RESEND variables...anyway i just had to put in dummy values so it can deploy.
When deployment was successful and i tried to train a model, it kept saying something went wrong, so i went to check the application logs in vercel and this is the error i was seeing
{ stripeIsConfigured: false }
TypeError: Cannot read properties of undefined (reading 'map')
at POST (/var/task/.next/server/app/leap/train-model/route.js:298:97)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /var/task/.next/server/chunks/778.js:5600:37
Please what could be the issue ?
My problem is that after purchasing credits successfully, the user's account does not get the credits, and the train model will still not proceed.
After purchasing credits I get a confirmation screen but no option to return to the site or anything, and have to hit the back button (Should I have it redirect back to the website, and if so, to what url?)
After hitting the back button and refreshing the user still shows 0 credits. My supabase seems to be correct in that it creates the user, but it is not creating "credits" property on the users account or adding the credit.
My stripe web hook secret, endpoint url and checkout.session.completed event seem to be correct from what I can tell:
When stripe is disabled the train model works correctly.
New to all of this, but I believe I've set all the stripe env variables etc correctly and it is not working even after purchasing credits. Any suggestions would be much appreciated.
Thanks in advance.
[POST]
/leap/train-model
Time
November 01 19:36:08.57 GMT+05:30
Request Path
/leap/train-model
Host
picmaker.app
Request ID
fvct9-1698847564533-4f135877464d
Request User Agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Level
Error
Environment
production
Branch
main
Type
Serverless Function
Function
/leap/train-model
Location
Washington, D.C., USA (iad1)
Runtime
Node.js 18.x
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at parseJSONFromBytes (node:internal/deps/undici/undici:6662:19)
at successSteps (node:internal/deps/undici/undici:6636:27)
at node:internal/deps/undici/undici:1236:60
at node:internal/process/task_queues:140:7
at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
This may be an issue on my end but the supabase setup only allows the service_role to insert rows in the credit table but a new user needs access to create an initial row leap/train-model route. Either that or another supabase client object is needed with service_role permission like is done in the other leap routes.
Please correct me if I'm wrong.
i rename .env.local.example as .env.local
and NEXT_PUBLIC_SUPABASE_ANON_KEY is in this file.
but vercel deploy also come up with the error do not exist NEXT_PUBLIC_SUPABASE_ANON_KEY .
plz help me:
22:33:20.937 | at 90791 (/vercel/path0/.next/server/app/leap/image-webhook/route.js:167:11)
22:33:20.937 | at webpack_require (/vercel/path0/.next/server/webpack-runtime.js:25:43)
22:33:20.937 | at webpack_exec (/vercel/path0/.next/server/app/leap/image-webhook/route.js:316:39)
22:33:20.937 | at /vercel/path0/.next/server/app/leap/image-webhook/route.js:317:74
22:33:20.937 | at webpack_require.X (/vercel/path0/.next/server/webpack-runtime.js:138:21)
22:33:20.938 | at /vercel/path0/.next/server/app/leap/image-webhook/route.js:317:47
22:33:20.938 | at Object. (/vercel/path0/.next/server/app/leap/image-webhook/route.js:320:3)
22:33:20.938 | at Module._compile (node:internal/modules/cjs/loader:1256:14)
22:33:20.938 | at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
22:33:20.939 | at Module.load (node:internal/modules/cjs/loader:1119:32)
22:33:20.939 |
22:33:20.940 | > Build error occurred
22:33:20.942 | Error: Failed to collect page data for /leap/image-webhook
22:33:20.942 | at /vercel/path0/node_modules/next/dist/build/utils.js:1158:15
22:33:20.942 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
22:33:20.943 | type: 'Error'
22:33:20.945 | }
22:33:21.033 | error Command failed with exit code 1.
22:33:21.034 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
22:33:21.069 | Error: Command "yarn run build" exited with 1
I cloned the repo and ran npm install
. This installs the latest version of next.js
. I am getting two errors when I run npm run dev
.
pages
directory. Please create one under the project rootCould you tell me what version you used initially to create headshots-starter? I would like to install that specific version so I can get your repo up and running.
Thanks.
There is no way to check the price after signing in.
In Leap ai the headshot template isnt available, when you click on it, it takes you to getavatars.ai website and doesnt allow you to select the template. Perhaps someone can provide the JSON code to import it?
While trying to install locally with npm install I get
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: headshots-ai-by-leap@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/next
npm ERR! next@"13.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^12.0.7" from [email protected]
npm ERR! node_modules/next-multipart
npm ERR! next-multipart@"^0.5.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Error: > Couldn't find a pages
directory. Please create one under the project root
at Object.findPagesDir (C:\Users\Ross\Desktop\RealChar\headshots-starter\node_modules\next\dist\lib\find-pages-dir.js:42:19)
at new DevServer (C:\Users\Ross\Desktop\RealChar\headshots-starter\node_modules\next\dist\server\dev\next-dev-server.js:107:66)
at NextServer.createServer (C:\Users\Ross\Desktop\RealChar\headshots-starter\node_modules\next\dist\server\next.js:137:20)
at C:\Users\Ross\Desktop\RealChar\headshots-starter\node_modules\next\dist\server\next.js:149:42
at async NextServer.prepare (C:\Users\Ross\Desktop\RealChar\headshots-starter\node_modules\next\dist\server\next.js:127:24)
at async C:\Users\Ross\Desktop\RealChar\headshots-starter\node_modules\next\dist\cli\next-dev.js:142:9
C:\Users\Ross\Deskto
I have attempted multiple times now to get this deployed, and every time I try to add the Supabase integration it get stuck processing. I have confirmed my Supabase account is active and working, but I cannot proceed with deployment because of this.
Can some one help me understand what I might be doing wrong or look into if this is an issue?
(node:8) ExperimentalWarning: buffer.File is an experimental feature and might change at any time
(Use node --trace-warnings ...
to show where the warning was created)
{ stripeIsConfigured: false }
{
code: 'PGRST204',
details: null,
hint: null,
message: "Column 'modelId' of relation 'models' does not exist"
}
Looks like even when running locally it needs the services of leap which seem to be always paid for
If that's the case not cool, as this is advertised as open source
Hope I am wrong :)
Sir can i add docker in Repository, which help to deploy applications quickly
After the workflow has run successfully, I get an error saying Webhook call failed: {"cause":{"name":"RequestContentLengthMismatchError","code":"UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","message":"Request body length does not match content-length header"}}
inside of the Leap AI dashboard logs.
This is also causing endless "training" state animation in the frontend and no images rendered (even though they have been created successfully). Simply the webhook call is failing for some reason.
Any idea why this could be happening?
hi, for the magic link it redirects to auth/confirm?token_hash=pkce_8f32441e43a8c465c022a629d7891269c6bf0bbe74a48f1156e130e4&type=email
but it looks like you removed the /auth/confirm route in commit 9232d73, visible here: https://github.com/astriaai/headshots-starter/tree/9232d739e016a668bb7d28d4f1b76760e09d38d1
is there sth I am missing or like how is it supposed to work from supabase?
Hello,
Upon clicking the email magic link I get the above error.
The url that is displayed on the email seems correct.
Can someone look into this please?
Thanks,
Mark
After Confirming signup it takes you to a /?code= URL and does not auth the new user in. Is this expected?
[POST]
/leap/train-model
Time
November 01 19:36:08.56 GMT+05:30
Request Path
/leap/train-model
Host
picmaker.app
Request ID
fvct9-1698847564533-4f135877464d
Request User Agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Level
Error
Environment
production
Branch
main
Type
Serverless Function
Function
/leap/train-model
Location
Washington, D.C., USA (iad1)
Runtime
Node.js 18.x
{ status: 520, statusText: '' }
Need instructions
When resizing the window below 1024px in width the "Home" and "Get Credits" buttons disappear. I tried to target this issue but I couldn't solve it, also in developer tools I can see the particular snippet of Tailwind code that causes this issue but I don't know which property to change in the code to not trigger it.
As the tiltle describing, after the vercel deploying, email magic link redirect to localhost:3000, so it won't work.
(node:86725) ExperimentalWarning: buffer.File is an experimental feature and might change at any time
(Use node --trace-warnings ...
to show where the warning was created)
{ stripeIsConfigured: false }
{
code: '23502',
details: null,
hint: null,
message: 'null value in column "status" of relation "models" violates not-null constraint'
}
Hi,
I have an issue deploying in vercel.
19:39:48.292 | Attention: Next.js now collects completely anonymous telemetry regarding usage.
19:39:48.293 | This information is used to shape Next.js' roadmap and prioritize features.
19:39:48.293 | You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
19:39:48.293 | https://nextjs.org/telemetry
19:39:48.293 |
19:39:48.383 | Creating an optimized production build ...
19:40:02.951 | ✓ Compiled successfully
19:40:02.951 | Linting and checking validity of types ...
19:40:09.465 | Collecting page data ...
19:40:12.577 | Generating static pages (0/9) ...
19:40:12.666 | Generating static pages (2/9)
19:40:12.723 | Generating static pages (4/9)
19:40:12.724 | DynamicServerError: Dynamic server usage: Page couldn't be rendered statically because it used cookies
. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
19:40:12.724 | at staticGenerationBailout (/vercel/path0/.next/server/chunks/859.js:1:3931)
19:40:12.724 | at Object.cookies (/vercel/path0/.next/server/chunks/859.js:1:1519)
19:40:12.724 | at w.getCookie (/vercel/path0/.next/server/chunks/207.js:1:4965)
19:40:12.724 | at w.getItem (/vercel/path0/.next/server/chunks/207.js:1:12982)
19:40:12.725 | at getItemAsync (/vercel/path0/.next/server/chunks/705.js:1:50595)
19:40:12.725 | at SupabaseAuthClient._recoverAndRefresh (/vercel/path0/.next/server/chunks/705.js:1:32089)
19:40:12.725 | at SupabaseAuthClient._initialize (/vercel/path0/.next/server/chunks/705.js:1:11941)
19:40:12.725 | at /vercel/path0/.next/server/chunks/705.js:1:11215
19:40:12.725 | at /vercel/path0/.next/server/chunks/705.js:1:21707
19:40:12.725 | at SupabaseAuthClient.lockNoOp [as lock] (/vercel/path0/.next/server/chunks/705.js:1:8633) {
19:40:12.726 | digest: 'DYNAMIC_SERVER_USAGE'
looking up there is workaround using export const dynamic = "force-dynamic" when using cookies, but this is already there in page.tsx
anyone else?
When I deploy and in the build phase I got error
type: 'Error'
Hey, awesome starter project! To make the configuration easier for everyone, could you do the following steps, please?
supabase
foldersupabase init
(make sure you have the latest version of the Supabase CLI installed!)supabase link --project-ref ********************
with your Supabase project id refsupabase db pull --linked
refThis will create a migration file with all the schema and RLS policies included, making the setup a lot easier for everyone. Once finished, make sure to commit the generated migration files and update your deploy button URL to include the supabase integration which will automatically set up the schema for folks when deploying to vercel:
Use Vercel’s deploy button generator to create a 1-click deploy button for your template. Set the Supabase relevant parameters as follows:
https://github.com/vercel/nextjs-subscription-payments/tree/main
oac_VqOgBHqhEoFTPzGkPd7L0iH6
to make sure the Supabase Integration will be installed./supabase
folder is located. Make sure to include /tree/branchname
here even if it’s on the main branch! This is crucial for the integration to fetch the migration and seed files. E.g. https://github.com/vercel/nextjs-subscription-payments/tree/main
I was able to setup everything including the credit table but the only value that is not saved/updated is the total number of credits.
The entry is created in the credits table and the user_id is correct:
RLS is set (tried it also without RLS):
Wihtin the API-logs from supabase I can see couple of these entries:
Thanks in advance for your help!
There is no Contributors section in readme file .
As we know Contributions are what make the open-source community such an amazing place to learn, inspire, and create.
The "Contributors" section in a README.md file is important as it acknowledges and gives credit to those who have contributed to a project, fosters community and collaboration, adds transparency and accountability, and helps document the project's history for current and future maintainers. It also serves as a form of recognition, motivating contributors to continue their efforts.
<stripe-pricing-table
pricing-table-id="prctbl_1NtEZSCMCmxSLOnr1kGCuIRl"
publishable-key="pk_live_51MS6I1CMCmxSLOnrhl3L60fqOQGXesUyz67QnTKMXBsspDEjifIaldAdrPZ5rAfg6A0VCEdNCoLwzwfnfKpD48bO00pvYzF8yG"
client-reference-id={user.id}
customer-email={user.email}
>
</stripe-pricing-table>````
"components/stripe/StripeTable.tsx"
In this file using stripe-pricing-table pricing-table-id and publishable-key are used directly, not from the .env file Why?
Hi - I've got this running, but adding credits through stripe the webhook callback is missing the client_reference_id, hence raising an error. Any suggestions ?
Hey guys,
I know is only a demo but step 5 is no longer necessary and if you do it will cause you problems.
I'm guessing in your supabase magic link template you have the following
because if I try the other thing you mention in step 5, it doesn't work and i just lost an hour of my time wondering why
cool app though! going to deploy to photo.ly
I have an instance with Vercel/Supabase and when I add pictures and return to the overview I just get this:
It's been like this for 2 days! Haven't got it to work properly yet. I initially added 8 photos, then reduced it to the minimum of 4 to try again.
Any ideas? As I'm not sure where to even begin troubleshooting
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.