Coder Social home page Coder Social logo

headshots-starter's Issues

Missing License

Would it be possible to add a LICENSE file to this repo? Thank you.

Issue with Astria AI callback

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?

Astria AI key needed?

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

Issue with APP_WEBHOOK_SECRET Environment Variable Not Being Recognized During Build

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:

  1. Double-checked that the environment variable is set in the Vercel project settings.
  2. Ensured that the variable is being correctly referenced in the code using process.env.APP_WEBHOOK_SECRET.
  3. Attempted to deploy with a simpler value for the environment variable to rule out issues with special characters.
  4. Reviewed the Vercel documentation and existing issues for any similar cases or additional configuration steps I might have missed.

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!

TypeError when iterating through headshots output on train-webhook

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

Screenshot_3

Error message on Vercel console

Screenshot_2

I'll make a PR to fix this issue.

Error when is stripe enabled false

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 ?

purchased credits don't appear on users account

Screenshot 2024-07-16 at 8 10 01 AM Screenshot 2024-07-16 at 8 11 39 AM Screenshot 2024-07-16 at 8 11 47 AM

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:

image

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.

Syntax error on /leap/train-model at JSON.parse (<anonymous>)

[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)

Missing row permission for credits table

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.

Screenshot 2023-10-10 at 1 59 28 PM

do not exist NEXT_PUBLIC_SUPABASE_ANON_KEY ? it do exist

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:

Error: MISSING NEXT_PUBLIC_SUPABASE_ANON_KEY!

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

Version of Nextjs

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.

  • warn - You have enabled the experimental feature (serverActions) in next.config.js.
    warn - Experimental features are not covered by Semver, and may cause unexpected or broken application behavior. Use at your own risk.
  • Couldn't find a pages directory. Please create one under the project root

Could 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.

Leap Ai

THhe models keep training forever.

Hey after deployment and testing strip I noticed that all the models are still in training and Resend is not being used at all. However, Astria has already generated the Images on the platform.

Please is any assistance would be greatly appreciated.

Screenshot 2024-04-05 142843
This is the screen where the models are training

Screenshot 2024-04-05 143104
These are the output's on the Astria platform

Workflow Template Not Available

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?

npm ERR! ERESOLVE unable to resolve dependency tree

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

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

Cannot get this deployed through Vercel - Stuck at adding Supabase integration

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?

Vercel Deploy Stuck

postgress stuff

(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"
}

Is this PAID?

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 :)

Add Docker

Sir can i add docker in Repository, which help to deploy applications quickly

Webhook call failed: RequestContentLengthMismatchError

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?

Sign up does not work

After Confirming signup it takes you to a /?code= URL and does not auth the new user in. Is this expected?

error on /leap/train-model { status: 520, statusText: '' }

[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: '' }

Responsiveness issue

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.

image_2023-12-13_200712612

image_2023-12-13_200538644
image_2023-12-13_200552639

Error running on local when stripe is not configured

(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'
}

  1. Supabase configured - Done
  2. npm run dev - Done
  3. http://localhost:3000 - Page rendering - Done
  4. magic received in email - Done
  5. images uploaded - Done
  6. click train model - this error appears

Status not changing to finished in real time

Even after it's finished, it'll just keep on spinning. If I manually refresh, the status correctly changes to finished, but isn't it supposed to change automatically?

I've enabled real time in all tables in Supabase.

What else could be wrong?

CleanShot 2024-05-02 at 09 01 26@2x

Error with DynamicServerError deploying in Vercel

Hi,

I have an issue deploying in vercel.

$ next build

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?

Deloy error

When I deploy and in the build phase I got error

Error: MISSING NEXT_PUBLIC_SUPABASE_URL!

type: 'Error'

Simplify Supabase Setup

Hey, awesome starter project! To make the configuration easier for everyone, could you do the following steps, please?

  • Delete the supabase folder
  • Run supabase init (make sure you have the latest version of the Supabase CLI installed!)
  • Run supabase link --project-ref ******************** with your Supabase project id ref
  • Run supabase db pull --linked ref

This 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:

Generate the deploy button

Use Vercel’s deploy button generator to create a 1-click deploy button for your template. Set the Supabase relevant parameters as follows:

  • Git Repository: set this to the root of your Next.js/Svelte/Vue etc app. Different branches and Monorepos are also supported. E.g. https://github.com/vercel/nextjs-subscription-payments/tree/main
  • Environment Variables: set any non-supabase environment variables required for your template. Remember the Supabase specific env vars will automatically be set and kept up to date by our integration.
  • Integrations
    • Integration IDs: Add oac_VqOgBHqhEoFTPzGkPd7L0iH6 to make sure the Supabase Integration will be installed.
    • External ID: Set this to the root of your project where the /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

Credit Points are not set/saved in the credits table

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:
image

RLS is set (tried it also without RLS):
image

Wihtin the API-logs from supabase I can see couple of these entries:
image

Thanks in advance for your help!

Feature: Adding contribution section to the readme.md file.

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.
contributors

Why are the Stripe pricing table keys used directly instead of being loaded from the `.env` file?

      <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?

Remove step 5 so people dont waste their time

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
image

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

Constantly training

I have an instance with Vercel/Supabase and when I add pictures and return to the overview I just get this:
image
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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.